Hi Tim,

Tim Hooper wrote:
Also related to this issue, after using another support screen I'd like to be able to bring the user back into the tree and have it scroll down to where they were before they left the screen...and not start at the top again. To accomplish this in the past before I found the Click framework...using JSP's, I've used Javascript like window.scroll(0,<%=scrollPosition%>). Is something like this possible using Velocity, or does the Tree provide something like this?

The Tree doesn't provide such functionality out of the box but you can enhance it with Javascript to do what you want. The easiest is probably to store a cookie which remembers the scroll location. See here for an example:

http://radio.javaranch.com/pascarello/2005/07/18/1121709316718.html

Even if you navigate away and come back the position will be remembered.

To include the Javascript you can create a custom Tree and override the method #getHtmlImports to return the needed Javascript. (dont forget about super.getHtmlImports() if you override it)

Alternatively you can include the Javascript in the page template, similar to what you did with JSP. Not sure how you stored the scrollPosition using JSP but the following is the equivalent Velocity code:

window.scroll(0, $scrollPosition);


kind regards

bob

Reply via email to