Wednesday, October 5, 2011

Re: Using Multiple Panels

i dont know if this is important but you also have a typo:

you are saying in your html page you have:
mainData1 and mainData2


and you are trying to get elements with ids: mailData1, mailData2

RootPanel.get("mailData1").add(mainPanel1);
RootPanel.get("mailData2").add(mainPanel2);


cheers,
agata

On 4 Okt., 23:36, paschn <lina.nivo...@gmail.com> wrote:
> It still doesn't work. The problem it that between the div elements in
> the HTML file I have some HTML elements (that cannot be implemented
> with GWT, like a captcha field), so I have to make those two panels
> (mainPanel1 and mainPanel2) work independently in 2 different
> RootPanels.
>
> On 4 Οκτ, 14:04, Sudhakar Abraham <s.abra...@datastoregwt.com> wrote:
>
>
>
>
>
>
>
> > Wrap  your VerticalPanel1, VerticalPanel 2  into  a
> > HorizontalPanel .   Finally, add your HorizontalPanel into your
> > RootLayoutPanel. Set the size for HorizontalPanel in gwt unit.
>
> > //example code.
>
> > public class MyProject implements EntryPoint
> >  {
> >   private Label firstNameLabel = new Label("First name:");
> >   private TextBox firstNameTextBox = new TextBox();
> >   private FlexTable dataFlexTable1 = new FlexTable();
> >   private VerticalPanel mainPanel1 = new VerticalPanel();
> >   private Label lastNameLabel = new Label("Last name:");
> >   private TextBox lastNameTextBox = new TextBox();
> >   private FlexTable dataFlexTable2 = new FlexTable();
> >   private VerticalPanel mainPanel2 = new VerticalPanel();
> >   private HorizontalPanel horizontalPanel = new HorizontalPanel();
> >   public void onModuleLoad() {
> >           //Assemble data table 1 and 2
> >           dataFlexTable1.setWidget(0, 0, firstNameLabel);
> >           dataFlexTable1.setWidget(0, 1, firstNameTextBox);
> >           dataFlexTable2.setWidget(0, 0, lastNameLabel);
> >           dataFlexTable2.setWidget(0, 1, lastNameTextBox);
> >           //Assemble main panel 1
> >           mainPanel1.add(dataFlexTable1);
> >           //Assemble main panel 2
> >           mainPanel2.add(dataFlexTable2);
> >           //Assemble two verticalPanel into HorizontalPanel
> >           horizontalPanel.add(mainPanel1);
> >           horizontalPanel.add(mainPanel2);
> >           horizontalPanel.setSize("500px", "400px");
> >           horizontalPanel.setVisible(true);
> >           RootLayoutPanel.get().add(horizontalPanel);
> >   }
>
> > }
>
> > S. Abrahamwww.DataStoreGwt.com
> > Persist objects directly in GAE

--
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-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment