aspose file tools*
The moose likes Struts and the fly likes Table navigation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Table navigation " Watch "Table navigation " New topic
Author

Table navigation

Michael Swierczek
Ranch Hand

Joined: Oct 07, 2005
Posts: 105
    
    1
I'm working on medical test software. You log in, and you have a number of menu choices on the left: Patients, Reports, Clinicians, etc...

Let's say a user clicks Patient, pages through the table to the third set of entries, clicks Reports, and then clicks back on Patient. By default, they get returned to the first page of the Patient table again. It would be much more convenient for them to be returned to the page of Patient they were most recently on.

I have a working solution, but it seems a little awkward and I'd like to see if something more straightforward exists.
Create a session attribute "menu locations" that is a Map. The Map keys are the menu choices, "Patients", "Reports", "Clinicians", etc... The Map values are the most recent HttpServletRequest.getQueryString() values when the user navigated through the corresponding menu. Each time the user clicks a menu item, check the request query string. If it is non-null, simply save it in the session Map and continue normally. If it is null, check the session Map for a value for that menu. If you find one, forward to that location.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Michael,

I don't see anything wrong with your solution. I know we're always our own worse critics, but from my point of view, it doesn't look awkward at all.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Table navigation
 
Similar Threads
Design help
JSF2 CRUD DataTable and SelectOneListBox Questions
JQuery table manipulation
OSCache
Use OSCache for performance tunning