That does exactly what I want it to do in the Hosted Mode browser,
when I compile and run it in Firefox it redirects the entire site to
whichever link was supposed to be only inside the Frame.

Once launched in Firefox it shows Google.com in the Frame as it
should.  Once I click Syllabus and it changes to google docs it
redirects the page completely and shows google docs just like you
would see google docs regularly.  Good-bye app.  I'll tinker with it
some.

I'm not sure if I need to publish it to the server to resolve this
issue or if this will cause quirks later.
Thanks Ian for the tip, that solved one problem. :)

On Aug 14, 5:27 pm, Ian Bambury <[email protected]> wrote:
> It really shouldn't ever show you anything except Google Docs.
> You set the frame to Google, then immediately check the history token length
> (which will be zero) and change it to Google Docs.
>
> End of.
>
> Unless you set some kind of history listener then clicking on the hyperlink
> will change the bookmark, but there's nothing there to react to it, so
> nothing is going to happen.
>
> Try something like this (make sure you have the history frame in your html)
>
> import com.google.gwt.core.client.EntryPoint;
> import com.google.gwt.event.logical.shared.ValueChangeEvent;
> import com.google.gwt.event.logical.shared.ValueChangeHandler;
> import com.google.gwt.user.client.History;
> import com.google.gwt.user.client.ui.DockPanel;
> import com.google.gwt.user.client.ui.Frame;
> import com.google.gwt.user.client.ui.Hyperlink;
> import com.google.gwt.user.client.ui.RootPanel;
> import com.google.gwt.user.client.ui.StackPanel;
> import com.google.gwt.user.client.ui.VerticalPanel;
>
> public class MainController implements EntryPoint,
> ValueChangeHandler<String>
> {
>
>     Frame syllabi = new Frame("http://www.google.com/";);
>
>     @Override
>     public void onModuleLoad()
>     {
>         StackPanel classes = new StackPanel();
>         DockPanel mainPanel = new DockPanel();
>         VerticalPanel cs211s1 = new VerticalPanel();
>         mainPanel.add(syllabi, DockPanel.CENTER);
>         syllabi.setSize("440px", "440px");
>         Hyperlink cs211syl1 = new Hyperlink("Syllabus", "s");
>         cs211s1.add(cs211syl1);
>         classes.add(cs211s1, "CS 211 Sec. 1");
>         mainPanel.add(classes, DockPanel.WEST);
>         RootPanel.get().add(mainPanel);
>         History.addValueChangeHandler(this);
>     }
>     @Override
>     public void onValueChange(ValueChangeEvent<String> event)
>     {
>         if(History.getToken().length() == 1)
>         {
>             syllabi.setUrl("http://www.gmail.com/";);
>         }
>         else
>         {
>             syllabi.setUrl("http://docs.google.com/";);
>         }
>     }
>
> }
>
> And unless you have a good reason for it, I'd swap the DockPanel and VP for
> divs
>
> Ian
>
> http://examples.roughian.com
>
> 2009/8/14 Paul <[email protected]>
>
>
>
>
>
> > I am running Eclipse with GWT and I have a Frame that I want to update
> > (refresh) it's contents when a selection is clicked from the
> > StackPanel.  When I run it right now it does not load the new web page
> > unless I click refresh several times.  Here is some of the code I'm
> > using.
>
> >                StackPanel classes = new StackPanel();
> >                DockPanel mainPanel = new DockPanel();
> >                VerticalPanel cs211s1 = new VerticalPanel();
> >                Frame syllabi = new Frame("http://www.google.com/";);
> >                mainPanel.add(syllabi,DockPanel.CENTER);
> >                syllabi.setSize("440px", "440px");
>
> >                if(History.getToken().length() == 1)
> >                {
> >                        //mainPanel.remove(syllabi);
> >                        syllabi.setUrl("http://www.gmail.com/";);
> >                }
> >                else
> >                {
> >                        syllabi.setUrl("http://docs.google.com/";);
> >                }
>
> >                Hyperlink cs211syl1 = new Hyperlink("Syllabus", "s");
> >                cs211s1.add(cs211syl1);
> >                classes.add(cs211s1, "CS 211 Sec. 1");
> >                mainPanel.add(classes, DockPanel.WEST);
>
> >                RootPanel.get().add(mainPanel);
>
> > Any help would be greatly appreciated.
--~--~---------~--~----~------------~-------~--~----~
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