There are any number of menus nested within each other. They are all
instances of the same widget. Eventually, you reach a non-menu, a real
'page'.

The top level menu reacts to history. It passes this to a routine in the top
menu called setMenuByToken(oldToken, newToken)
It may get passed a token like Admin/Database/Reset

The '/' is a delimiter.

It splits out the 'Admin' part and shows the Admin page which is also, in
this case, a menu.

So within the toplevel (site) menu, we now have the Admin menu displayed.

The site menu calls setMenuByToken(oldToken, newToken) on the Admin menu

oldToken is now "Database/Reset", newToken is "Admin"

The Admin menu does the same as the site menu (since it is an instance of
the same framework widget) - it displays the Database page (also a menu) and
calls the database.setMenuByToken() routine with "Reset" and
"Admin/Database"

The database menu displays the Reset page. Since this is the final page and
not a menu, it writes out the history token "Admin/Database/Reset"

Now I know that it looks a bit silly, writing out what we started with, but
the system also reacts to menu item clicks. If you click on menu items
rather than react to history, a new token will be built up from that point
on.

Getting the token for a history change is done in the top-level menu. It
just passes it to the setMenuByToken routine. The menus then cascade down
displaying whatever is required (or a default if there is nothing specified,
or the last displayed page if there has been one)

When eventually a non-menu is displayed, a new history item is created.

If at this point, the existing history item is blank, I want to replace it
with the new history item.

All the processing code is in a framework project, the actual token is based
on the menu text that the using project sets up, so I have no idea what the
actual token will be.

I don't know if that is any clearer :-)

Ian

--~--~---------~--~----~------------~-------~--~----~
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