> I bring this up because struts seems to have gone partway--better than
> any other framework I've seen--but not all the way in its support of
> this dialog box metaphor (it uses form beans).  What is now 
> needed is a navigation stack of some kind--perhaps even something that
> is written/phrased in terms of "traditional" UI metaphors.

I've implemented something like this as follows.

I make frequent use of a metaphor whereby the form contains an edit
field with an adjacent button (text: "...") that allows lookup of
values in the edit field.  This allows the user to enter the value
directly if they know it, or to click on the "..." button to perform
a search.  (This presumes that there are too many choices for a
select field to make sense.)

I want to be able to perform the search and return to this screen
with both the existing data and the search results filled in.  I
want the user to be able to do this in multiple browser windows
without them interfering with each other.  I want the "back" button
to work as expected, because I know that as a user, I get very
annoyed with the inability to use this button.

When the user clicks the "..." search, the entire calling state,
including the ActionForm bean, is copied into a cache which is
stored on a per-user basis.  From the cache, I get a unique token to
refer to the calling state.  This token is then stored in a hidden
"caller" element on the new form.  If the user moves forward from
this screen by pressing either "OK" or "Cancel", the original form
is restored from the cached information, the cached value becomes
eligible for destruction, and after a short grace period, the form
is removed from the cache.  If the user presses the "Back" button,
the form remains in the cache longer, although it, too, will
eventually time out and be destroyed.

In any event, once the user's session is terminated, any saved forms
are destroyed.

This approach works very well for me.  A stack is implicitly defined
by the succession of "caller" elements without having to maintain
anything that looks like a stack on a global level.  I don't know
how well this approach scales, but short of keeping all of the state
information in the user's browser, I can't think of any way to
reduce its footprint.

--
Curt Hagenlocher
[EMAIL PROTECTED]

Reply via email to