aspose file tools
The moose likes JSF and the fly likes Retain Scroll Position Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Retain Scroll Position" Watch "Retain Scroll Position" New topic
Author

Retain Scroll Position

m yasmin
Greenhorn

Joined: Nov 11, 2008
Posts: 9
Hello,
Is there a way to retain the Scroll Position in JSF? I have a page that uses both standard JSF and Tomahawk tags. Everytime the page reloads it jumps to the top.

I used JavaScript as a work around. However, I am wondering if there is a better solution.

Thanks,
Yasmin
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Not without using a client side language such as Javascript. It is as far the only language which can tell you something about the current scroll position and is able to change it.

JSF runs entirely at the server side and just produces a bunch of HTML. It can't to anything for you here.


Code depot of a Java EE / JSF developer | JSF / Eclipse / Tomcat kickoff tutorial | DAO kickoff tutorial | I ♥ Unicode
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
[edit] Got server error? Anyway, this post got doubleposted. Removed now.
m yasmin
Greenhorn

Joined: Nov 11, 2008
Posts: 9
Thanks a bunch. I thought I would ask just in case you guys know a better way.

Yasmin

Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
This message was edited 2 times. Last update was at Today 15:26:12 by Bauke Scholtz
Funny, I edited it only 1 time. The forum software is bugging.
m yasmin
Greenhorn

Joined: Nov 11, 2008
Posts: 9
mr.gluck,
I just put focus on the buttons of the page so the page does not jump to the top when a particular button is clicked.

<snippet>
onclick="document.getElementById['element'].focus();"
</snippet>

Hope it helps.
Yasmin
 
I agree. Here's the link: http://jrebel.com/download
 
subject: Retain Scroll Position
 
Similar Threads
Scroll bar does not retain its position after or before pack
Internet Explorer Scroll bar
Html contents displayed by servlet
JSP + useBeans + flush all my contents in my page
How to maintain scroll position in JSP?