[SOLVED] CheckBox in tree component (2.0)

UI Components for JSF
Post Reply
martinezjavier
Posts: 17
Joined: 01 Feb 2010, 17:17

02 Feb 2010, 15:13

Preview: CheckBox in tree component (2.0)
I'm using primefaces 2.0 with JSF 2.0. In primefaces 1.0 the tree component can have checkbox capabilities.

How can I have the same behavior with primefaces 2.0?

I read that I could define a component as a tree node. How can I do that?

Basically what I want is to asociate a ACL tree with each Role in my system.

Thanks a lot,

Javier

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

02 Feb 2010, 16:09

PrimeFaces 1.x and 2.x is no different in terms of featureset. Checkbox based selection applies to 2.x as well.

martinezjavier
Posts: 17
Joined: 01 Feb 2010, 17:17

02 Feb 2010, 17:05

I dont get it. In component showcase (which I think is based on primefaces 1.0). The description of the Tree component says "Tree has built-in support for checkbox based node selection, just define a TreeNode array that will be used to populate the selected nodes."

Wich is true because if you define a tree al the nodes are check selection.

But in primefaces 2.0, I defined a tree

<p:tree value="#{rolController.raiz}"
toggleMode="async"
nodeSelectListener="#{rolController.nodoSeleccionado}"
nodeExpandListener="#{rolController.nodoExpandido}"
nodeCollapseListener="#{rolController.nodoContraido}">
</p:tree>

The nodes are being populated but they are only text labels. They dont have a selection check component. Also "selection" (for selected nodes) is not a valid attribute of the tree component in primefaces 2.0.

Thanks

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

02 Feb 2010, 17:45

I see, that feature is added after 2.0.0.RC so you need a nightly build of 2.0.0-SNAPSHOT or wait a little until the release.

Nightly builds are at;

http://repository.prime.com.tr/org/prim ... -SNAPSHOT/

martinezjavier
Posts: 17
Joined: 01 Feb 2010, 17:17

02 Feb 2010, 18:13

Thank you very much! Now with the snapshot is working like a charm...

If I had read the forum carefully, I would noticed about it. Because I saw that you answered that question in a previous post. Sorry for that

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

02 Feb 2010, 18:44

No problem. :)

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 66 guests