Well I think I may be able to answer my own question:

As part of the GWT SDK there are some demo applications which show off
the features of the GWT product (http://code.google.com/webtoolkit/
examples/).  One of these applications, the showcase application,
matches the complexity I am looking for (http://gwt.google.com/samples/
Showcase/Showcase.html).  This has many different UI controls rendered
as a result of clicking options in another child control.  The
implementation is very slick, as you would expect from Google.
Examination of the code has provided me with an insight into many Java
objects I wasn't aware of, and the bubbling and transfer of events is
easily demonstrated.

In essence the EntryPoint class (Showcase.java) initialises the
framework by creating a sidebar menu tree where menu options are
associated with UI objects, using a HashMap.  When a tree option is
selected an event is raised in Showcase where the decision is made on
what to render.  This rendering operation is passed to a different
object  (Application.java) which controls the look of the
application.  So in summary:

Entry Point Class : Showcase.java : Controls setup and the flow of
events.
Visual Display : Application.java : This displays the application in
whatever way it is told too.

I think is a great start.

Cheers
Gene



On Apr 15, 4:21 pm, drthink <drgenejo...@gmail.com> wrote:
> I am developing a website and have a what might be relatively easy
> question for a GWT native.  The question surrounds how to create and
> initialise objects within GWT.  I am a former ASP.Net developer so my
> questions are along the lines of how I do something I would have
> previously done in that framework in the new GWT format.
>
> *** Question
> Well, if I have a GWT application which consists of one
> Application.Html file which is the holder for the application.  This
> translates to one EntryPoint and one "Main" application module.  Now
> if this application consists of various visual elements which can be
> shown according to the interactions of the user then where is the best
> place to instantiate and initialise these objects.
>
> For instance if I have a MenuHeader UI Declarative objects and a
> SideMenu Object and a MainArea object.  These are all rendered at
> start up in the EntryPoint module.   Now the MainArea object could
> display say 20 different other objects depending on what the user is
> doing in the application, and the choice of object displayed is
> dependent on the users selections in other child objects.  My question
> surrounds on the best way of handling this interaction.
>
> *** Solution 1: Bubble events up to Main Application Module
> Do I implement an event bubbling mechanism where events are raised up
> the main level and then objects are instantiated there and rendered
> accordingly?
>
> *** Solution 2: Pass listeners to child objects
> In the mail application supplied by Google they add this code in the
> entry point module:
>     // Listen for item selection, displaying the currently-selected
> item in
>     // the detail area.
>     mailList.setListener(new MailList.Listener() {
>       public void onItemSelected(MailItem item) {
>         mailDetail.setItem(item);
>       }
>     });
>
> So does this mean for every event I would expect then in the Main
> module I have to create a listener?
>
> *** Solution 3: Something I am not aware of.
> Solutions 1 and 2 do not seem to be good solutions for large
> applications so is there something I am not aware of that GWT does or
> some coding practice that someone else can suggest.
>
> There maybe a good open source application I can refer to that deals
> with this problem so any links to good examples are warmly welcomed.
>
> Regards
> Gene Conroy-Joneswww.sohoappspot.com
>
> --
> 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-tool...@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-web-toolkit+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/google-web-toolkit?hl=en.

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

Reply via email to