I haven't tried using anchors in JSF but presumably that would be the
solution.  Since the nodes are all JSF objects if you can find a way
to add a '#foo' to the URL then you could scroll to the specific
location.  I don't believe there is a way to do this in the JSF spec
but its probably something that should be supported.  Your use case is
a pretty common one (I've experienced this before.)

There is a post on the Sun forum that deals with the issue[1].  Maybe
this is a case for a new attribute for commandLink/commandButton?

Sean

[1] http://forum.java.sun.com/thread.jspa?threadID=490215&messageID=2301780



On 7/31/06, Adam <[EMAIL PROTECTED]> wrote:
Dear All,

we are happily using tree2 & the problem I have is to do with the scrolling.

Is there anyway to tell the scrooling mechanism to scroll to a given node?

i.e. we have a tree which is sufficiently large that it needs a scroll
bar etc. When we add a new node, it is added to the end of the tree in
some applications & in a sorted position in others (e.g. the nodes are
alphabetically sorted).his means that when a user clicks to add a new
node, he has to scroll down to the end of what might be a large tree
every time which can get to be a pain for those inserting data.

I add a node as follows:

                Node XPNode = deb.addChildN();
                String path = dtb.getpathToRoot(XPNode);
                dtb.tree.expandPath(dtb.tree.getPathInformation(path));

& the node happily expands etc but....that in no way interacts with the
scrolling. i..e the node is expanded but it's still off the page &
requires scrolling to get to it.

So how do I (can I?) set the focus to the node added as above such that
the scrolling mechanism takes the user to that node?

TIA


Adam


Reply via email to