jQuery in Action, 2nd edition*
The moose likes HTML, CSS and JavaScript and the fly likes How to maintain the old focus after page reload? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to maintain the old focus after page reload?" Watch "How to maintain the old focus after page reload?" New topic
Author

How to maintain the old focus after page reload?

sivaprasad adusumalli
Greenhorn

Joined: Jun 12, 2008
Posts: 2
Hi ,

In my screen i have a table. Table has 8 columns and several rows. In 8 columns, one of the column value has link is there for open the popup. when i am going to select the link to open the popup the entire row will be heighlighted ( means it shows in gray color). After updations done in popup, popup page will close and comeback to the previous page i.e in table page and that table page will be reloaded and updations will be showing. but the problem is prevoius focus (i.e previous heighlighted color gray) is not maintaining. So, what is problem? can any body give the solution?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60752
    
  65

Originally posted by sivaprasad adusumalli:
So, what is problem?
Well, of course if a page is reloaded it's going to revert to its initial state. If you've changed client-side state and need to recreate that state, then you need to remember the state somehow and restore it on page load. You could do that in a server-side session or perhaps cookies, or by passing hidden inputs around.

P.S. "updations" is not a word. The correct word is "updates".


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
sivaprasad adusumalli
Greenhorn

Joined: Jun 12, 2008
Posts: 2
Can you give some example on that?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60752
    
  65

Not really. It could be fairly involved.

And you can restore the state on the server using JSP (or other templating mechanism) before the page even gets sent to the borwoser, or on the client at page load.

If all you need to remember is which row to "focus" then you could use a hidden input that's part of a form submission, or a cookie, or even the hash suffix of the URL.
 
Consider Paul's rocket mass heater.
 
subject: How to maintain the old focus after page reload?
 
Similar Threads
Two focused window at the same time
JTable Problem
history.back() not retaining changed values in previous page after window.open() call
focus of JPanel
Window.opener problem