Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setting focus on a row, after refreshing the page

 
Abrahim Daver
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at this link and see if this solves your problem without a lot of coding.

Eric
 
Abrahim Daver
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
whoops, forgot the link: http://radio.javaranch.com/pascarello/2005/10/28/1130527575367.html

Eric
 
Abrahim Daver
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic