I solved the problem, but it isn't as clean as I'd like it to be. I
manage the switch myself by putting a meta tag in the head and
selecting my view widget by the class name. Consequently, I have to
maintain a global list of available views. It works for now until I
can find a solution that leverages functionality native to GWT.

<meta name='View' content='{View Class Name}' />

Global.java
public static void init()
{
        NodeList<Element> nodes = XDOM.getHead().getElementsByTagName
( "meta" );

        for( int i = 0, il = nodes.getLength(); i < il; ++i )
        {
                Element el = nodes.getItem( i );
                String name = el.getAttribute( "name" );

                if( name.equals( "View" ) )
                {
                        String content = el.getAttribute( "content" );

                        if( content.equals( Global.Views.INDEX ) )              
        Global.VIEW = new
IndexView();
                        else if( content.equals( Global.Views.DASHBOARD ) )     
Global.VIEW =
new DashboardView();
                        else if( content.equals( Global.Views.SIGNUP ) )
Global.VIEW = new SignupView();

                        break;
                }
        }
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to