Am Montag, 3. September 2012 23:25:04 UTC+2 schrieb Andrei: > > Magnus, > > Jens is right: all you need is a simple FlowPanel with a Label and a > button inside. Set the button style to "float: right", set its width > (which, I assume, is constant), and add a right margin to your label which > is wider than the button. That's it. Your generated code will be 10 times > smaller (layout panels produce a lot of HTML), and your pages will reflow > much faster. > > You don't need to worry about the height: a FlowPanel will expand > automatically to accommodate its contents. If you want, you can fix its > height, or you can use min-height and/or max-height CSS rules. You can set > a width of the FlowPanel in pixels or as percentage of its parent's width, > or you can let it expand with the content up to a specified maximum. You > can allow the content to wrap inside the widget, or you can force it to > show ellipsis when the label gets too long, or you can force a scrollbar, > etc. There are a lot of options available to you in CSS. I use layout > panels only for page structure, and I never use HorizontalPanel or > VerticalPanel - they offer nothing that cannot be easily done with > FlowPanels and CSS, while they are less flexible as you have discovered. > > My advice: when building a layout, forget about widgets. Think how you can > do it in pure HTML/CSS, ideally without any <table> elements. Once you do > it, the choice of widgets becomes obvious. > Hi Andrei, thanks, I'll change the composite widget to be a FlowPanel, but I am sure that it gets 0 sizes when inserted into the LayoutPanel. But it's a precondition that the outer environment is a LayoutPanel, because this is used - as you mentioned - for the page structure. I understand that you recommend doing the overall page layout using LayoutPanels, but doing the small stuff concerning widgets with HTML/CSS? Then there must always be a "border crossing" between the outer layout panels and the inner HTML/CSS widgets. And exactly at this border you have to insert a widget into a layout panel, right? How do you do this? When I do it, the widget gets 0 sizes and I have to hard code the sizes explicitely, resulting in ugly code... Magnus
-- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/StcLmVxOLgYJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
