I was wondering if anyone knew of an easy way to use a StackPanel
header as a hyperlink. I'm trying to make a navigation menu using
StackPanel and vertical panels. However, there are one or two menu
items that have no submenu (thus no VerticalPanel).
Currently, my VerticalPanel consists of Hyperlink widgets because when
clicked those modify that history token and thus I could change the
content area of the app accordingly. But because there is no
VerticalPanel (and thus no Hyperlink) for certain menu items where
only the Header should be the link, I do not know what to do.
The only way I have been able to accomplish this was using
StackPanel navigation = new StackPanel();
SimplePanel content_wrapper = new SimplePanel();
navigation.add(new HTML(""), "<a href='#welcomeWidget'>Home</
a>",true);
and then in
onHistoryChanged(String historyToken) {
if (historyToken.equals("welcomeWidget")
content_wrapper.setWidget(welcomeWidget);
}
I'm not sure if this is the best way to change the content region
(using onHistoryChanged and looking at the name of historyToken and
setting widget accordingly), but it works. However, when clicking the
new 'Home' tab, the whole application must reload, rather than just
changing out the widget. I assume this is because I am treating the
header as HTML.
Is there a better way to accomplish this?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---