Help with GWT FlowPanel and other Panel Styles!

876 views
Skip to first unread message

Tan Jia Bao

unread,
Feb 19, 2010, 1:17:25 AM2/19/10
to Google Web Toolkit
Hi, I'm currently making an e-commerce site using GWT and DnD.
 
Basically everything is well and in order except for the displaying of the panels is done correctly.
 
I'm using GWT RPC to retrieve the data from my DAO, in my main GWT RPC Client side, the data are used to create a new Widget where stuffs such as the Product name and Image are used in.
 
In that Widget's constructor, I put all the Labels, Image into a Vertical Panel, the constructor is created with UsageExample client side file, in that client file, I have a FlowPanel which adds the widget into itself. Then my mainentrypoint calls and retrieves that FlowPanel and placing it into the mainPanel to display on the webpage.
 
Thing is, the FlowPanel doesn't display like a FlowPanel, but rather like a VerticalPanel, I tried changing it to horizontalPanel and it works, everything else works except for the FlowPanel. Can anyone help on what I'm doing wrong? Thanks!

RPB

unread,
Feb 19, 2010, 6:40:53 AM2/19/10
to Google Web Toolkit

A FlowPanel will act like a vertical panel (since block-level elements
will naturally stack up vertically) unless you change the CSS property
of it's children to float:left;

Have a look at this for further info:
http://code.google.com/webtoolkit/doc/latest/DevGuideUiPanels.html

Tan Jia Bao

unread,
Feb 19, 2010, 10:57:48 PM2/19/10
to google-we...@googlegroups.com
Hi, thank you for your reply.
 
I've done what you said and attached a CSS style to that flowpanel but it still wouldn't work, though I'm not sure whether is my css file in the correct folder but it works for my regular webpage.
 
However, when I attach a style to some GWT generated text, it doesn't work. What am I probably doing wrong? Thanks again!

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.


RPB

unread,
Feb 20, 2010, 3:00:24 AM2/20/10
to Google Web Toolkit
You need to apply the CSS to the children of the FlowPanel (i.e. what
you are adding to the panel) rather than the FlowPanel itself.
Out of interest, are you using UiBinder or not? Any particular reason
you don't want to use HorizontalPanel?

> > google-web-tool...@googlegroups.com<google-web-toolkit%2Bunsubs­cr...@googlegroups.com>


> > .
> > For more options, visit this group at

> >http://groups.google.com/group/google-web-toolkit?hl=en.- Hide quoted text -
>
> - Show quoted text -

Tan Jia Bao

unread,
Feb 22, 2010, 9:33:42 PM2/22/10
to google-we...@googlegroups.com
Hi, Once again thank you for your reply.
 
I finally solved the problem, turns out I forgot to import the CSS file in my HTML and your suggestion worked out well.
 
I didn't want to use HorizontalPanel because I'm doing an e-Commerce site so i want it to flow well. I'm not using UiBinder though, any advantages in using that?
 
Thank you!

To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.

RPB

unread,
Feb 23, 2010, 12:03:36 PM2/23/10
to Google Web Toolkit
UiBinder is GWT's new way of laying out your webpage - released in GWT
2.0. It's a more natural way of laying out your webpage and also makes
it easy to apply CSS rules to specific widgets. See this link for
further details: http://code.google.com/webtoolkit/doc/latest/DevGuideUiBinder.html

It does take a little getting used to, but if you're already using GWT
2.0, I would encourage using UiBinder.

> > > >http://groups.google.com/group/google-web-toolkit?hl=en.-Hide quoted

Reply all
Reply to author
Forward
0 new messages