wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Setting focus on a row, after refreshing the page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Setting focus on a row, after refreshing the page" Watch "Setting focus on a row, after refreshing the page" New topic
Author

Setting focus on a row, after refreshing the page

Abrahim Daver
Ranch Hand

Joined: Aug 06, 2004
Posts: 69
Hi,
The situation is like, I have a page where I display multiple rows( and scroll appears on the page), each row has got a radiobutton at the start of it and page is having a button named as "Add New Row", which intern add a row in the existing rows. Now, while adding a row, it refreshes the page and focus comes on first row, even though if I select last row, it keep that row selected after refreshing the page(for which I have written some machanism) but that selected row does not come in picture, because of scroll bar. I want to keep that selected row in focus, after getting it refreshed, for which I have to write a command in JavaScript on page load, which will solve my problem... Will anybody, please, put some thought/solution over this.
Thanks,
Abra
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Take a look at this link and see if this solves your problem without a lot of coding.

Eric
Abrahim Daver
Ranch Hand

Joined: Aug 06, 2004
Posts: 69
I am not able to figure out the link, you are talking about.
The links below, are redirecting me to the link of two books.
Please clarify one more time.
Thanks,
Abra
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
whoops, forgot the link: http://radio.javaranch.com/pascarello/2005/10/28/1130527575367.html

Eric
Abrahim Daver
Ranch Hand

Joined: Aug 06, 2004
Posts: 69
Thanks for your solution, but still my problem is not resolved.
As current solution fixes the position in a div, but it doesnot move from that position. If I add rows in existing table and it refreshes the page, but it doesnot focus on last line. Instead, if we can define id with each row, which,intern, is going to set at last position. Or something like that.... I am not able to recollect the command that does this task, which I came across few years back.
Any suggestion/solution, highly appreciated.
Thanks,
Abra
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You have this: http://radio.javaranch.com/pascarello/2005/12/14/1134573598403.html

or this: http://radio.javaranch.com/pascarello/replyToComment.action?entry=1105293729000&comment=1123416562826

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Setting focus on a row, after refreshing the page
 
Similar Threads
adding a JCheckBox in a JTable
Dynamically Scrolling to the newly added row in HTML table.
JTable and ScrollPane movement
adding JCheckBox in JTable
Highlighting a row in a table