Well, first let me tell yo that I am new to GWT myself. So, I might
not be right all the time. (But I have done and tested already what I
said earlier)
Now
--that means i require just a single EntryPoint class..! I am trying
to
--create my web app's main menu using a MenuBar, and a major area
below it
--will display the contents of each MenuItem.
Ok, you can do this by putting a MenuBar and SimplePanel in a
VerticalPanel and then adding VerticalPanel to RootPanel.
--Can i use multiple RootPanel's in my web app..? i read somewhere
that this
--is discouraged.
Don't know if it is really discouraged but you can do so. Design your
html page as you like and give id attribute for those elements that
you want to access as rootpanels. Now in code you can say
RootPanel elementRootPanel = RootPanel.get("idOfTheElement");
to get your hands on it.
--ok, i got wat you are saying over here. Why should these classes
extend
--Composite?
Well GWT has it's own class hierarchy and to make things work and to
enable GWT use your custom "Composite" component, you need to extend
it from Composite. You might extend it from Widget or Some Panel, but
Composite is recommended I guess.
--Can you use separate methods in the class to return the data.
I couldn't understand the question
--What is this last line doing?
The last line is in fact adding what ever you layedout to DOM.
--how do i add clickListener to MenuItems, i think i can only specify
--commands to perform.
Try looking into javadocs of GWT.
In the case of MenuItem, I can use Command for the same purpose.
MenuItem item = new MenuItem("Click Me", new Command() {
public void execute() {
// Do the navigation here
containerSimplePanel.setWidget(new SomeCompositeInheritedClass
());
}
});
Hope it helps
Omer Akhter
On Jan 9, 1:59 pm, "Sahil Dave" <[email protected]> wrote:
> On Fri, Jan 9, 2009 at 1:52 PM, A Friend Of Yours
> <[email protected]>wrote:
>
>
>
>
>
> > The same problem I was having a few days ago...
>
> > Well gwt abstracts web applications not as a multiple interlinked
> > pages but as widgets and panels like a desktop GUI framework. You can
> > add widgets to panels, switch panels in frames etc...
>
> > What I did in my case is somewhat like this
>
> > 1. Create a class that implements EntryPoint(which you might already
> > have). Layout everything as you like and put a SimplePanel in the area
> > where you want the contents to change.
>
> > Like this
> > -------------------------------------------------------------------------
> > |Logo Application Title etc |
> > -------------------------------------------------------------------------
> > | Navigation Button1 | |
> > | Navigation Button2 | SimplePanel |
> > | Navigation Button3 | |
> > | ....
> > | |
> > -------------------------------------------------------------------------
> >> that means i require just a single EntryPoint class..! I am trying to
>
> create my web app's main menu using a MenuBar, and a major area below it
> will display the contents of each MenuItem.
> Can i use multiple RootPanel's in my web app..? i read somewhere that this
> is discouraged.
>
>
>
> > 2. Create on class for each content that you want to put in
> > SimplePanel. It should extend Composite. Also, it must initialize and
> > layout everything in one Grid or Panel or Table in the constructor.
> > The last line in constructor should be like this
>
> > initWidget(thePanelThatContainsEveryThing);
> >> ok, i got wat you are saying over here. Why should these classes extend
>
> Composite? Can you use separate methods in the class to return the data.
> What is this last line doing?
>
>
>
> > 3. On add a clickListener to each navigation button and in that
> > function:
>
> > contentSimplePanel.setWidget(new contentClass1());
>
> >> how do i add clickListener to MenuItems, i think i can only specify
>
> commands to perform.
>
> --
> Sahil
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---