Sean Schofield wrote:
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



Thanks. It does appear to be a fairly std thing for a tree to do. Maybe some sort of "setFocus" method on the tree where like expand you provide a path? In fact you could combine expand and setFocus into one i.e. calling setFocus should expand that node/path & then set the focus onto that node.

e.g.:

String path = dtb.getpathToRoot(XPNode);
dtb.tree.setFocus(dtb.tree.getPathInformation(path));


Adam

Reply via email to