开发者

How do I present a RichFaces tree with a specific node already expanded

开发者 https://www.devze.com 2022-12-25 06:07 出处:网络
I have a JSF page that displays a RichFaces Treeview, from a TreeNodeImpl model generated in the backing bean.

I have a JSF page that displays a RichFaces Treeview, from a TreeNodeImpl model generated in the backing bean.

Now I want the page to display initially with a specific node expanded / selected. Preferrably this expansion should be controlled from the backing bean (no javascript wizardry)

The whole tree has been ge开发者_运维问答nerated at the time of initialization of the backing bean

Is this possible? I have seen mentioning of TreeState, is that the way to go?


<rich:tree> has a property called adviseNodeOpened (check here)

It should contain a javax.el.MethodExpression. The target method signature must match

java.lang.Boolean adviseNodeOpened(org.richfaces.component.UITree)

This is documented as:

MethodBinding pointing at a method accepting an org.richfaces.component.UITree with return of java.lang.Boolean type. If returned value is: java.lang.Boolean. TRUE, a particular treeNode is expanded; java.lang.Boolean.FALSE, a particular treeNode is collapsed; null, a particular treeNode saves the current state

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号