Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with row focus and scroll

 
Anusha Reddy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a table with a set of rows. And set color to the rows when up/down arrows are pressed. The scroll bar moves down when down arrow is pressed and moves up when up arrow is pressed.

But in my code, when i press down arrow on the last row, the focus should go to the first row. here to set focus i have just set colors to the corresponding rows. The problem is.. when i have more rows, when i try to scroll top from last row, focus is going to the first row, but as the scroll bar remains down, the first row is not visible. How can i move my scroll bar to the row focused?
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have code that figures out where the row is located on the page and than you use window.scrollTo() to move there?

Eric
 
Anusha Reddy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no i dont have
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic