I also had the same problem, and the only way I found was to do this programmatically, with
@UiField(provided=true) VerticalPanel verticalPanel; And instantiating the vertical Panel + setting the horizontal alignment before calling uiBinder.createAndBindUi(this) On Mar 18, 9:27 am, Gecko <[email protected]> wrote: > I'm trying to center a vertical panel on the browser but it does not > work. I'm newbie... help me please !!! > > I'm using UiBinder as shown below : > > <g:HorizontalPanel horizontalAlignment="ALIGN_CENTER" width="100%" > > <g:VerticalPanel> > ... > </g:VerticalPanel> > </g:HorizontalPanel> > > From the ui.xml, the java code below is gennerated : > > com.google.gwt.user.client.ui.VerticalPanel f_VerticalPanel2 = > (com.google.gwt.user.client.ui.VerticalPanel) > GWT.create(com.google.gwt.user.client.ui.VerticalPanel.class); > com.google.gwt.user.client.ui.HorizontalPanel f_HorizontalPanel1 = > (com.google.gwt.user.client.ui.HorizontalPanel) > GWT.create(com.google.gwt.user.client.ui.HorizontalPanel.class); > > f_VerticalPanel2.add(okbandeau); > f_HorizontalPanel1.add(f_VerticalPanel2); > f_HorizontalPanel1.setHorizontalAlignment(com.google.gwt.user.client.ui.Has > HorizontalAlignment.ALIGN_CENTER); > f_HorizontalPanel1.setWidth("100%"); > > And finally, I obtain the html code below : > > <table cellspacing="0" cellpadding="0" style="height: 100%; width: > 100%; position: absolute; left: 0px; top: 0px; right: 0px; bottom: > 0px;"> > <tbody> > <tr> > <td align="left" style="vertical-align: top;"> > <table cellspacing="0" cellpadding="0"> > <tbody> > <tr> > <td align="left" style="vertical-align: top;"> > <table cellspacing="0" cellpadding="0"> > <tbody> > <tr> > <td align="left" style="vertical-align: top;"> > ... > </td> > </tr> > </tbody> > </table> > </td> > </tr> > </tbody> > </table> > </td> > </tr> > </tbody> > </table> > > I think I made a mistake somewhere because I get in the first "td" <td > align="left" style="vertical-align: top;"> when I should <td > align="center" style="vertical-align: top;"> > > Thank you for any help. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. 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.
