Problems using tree component of primefaces

UI Components for JSF
tatun78
Posts: 22
Joined: 04 Jun 2009, 13:32

05 Jun 2009, 08:34

Hi, I am having some problems with the tree component in primefaces. I am using Java Content Repository(JCR)'s repository setup and primefaces to build a dynamic tree. The tree is coming as per the repository setup which is OK. Now
I am trying to get the node name in the backing bean methods corresponding to nodeSelectListener, nodeCollapseListener and nodeExpandListener by clicking on the nodes of the tree, but none of the nodeSelectListener and nodeCollapseListener is firing any events to the backing bean and when I am expanding a node only once the call is reaching to the corresponding method of the backing bean. But no event is fired when this node is clicked again. Please let me know what I should do to solve this problem.
:cry:

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

05 Jun 2009, 10:20

Hi, yes it's a known issue that's probably broken after the 0.8.3 release. 0.9.0 is coming out on monday 8th june and this will be fixed today or tomorrow. Thanks for your feedback!

tatun78
Posts: 22
Joined: 04 Jun 2009, 13:32

05 Jun 2009, 13:04

Thanks. I am waiting eagerly for the new release of primefaces on Monday(8th June). Could you please let me know that whether I can download the new primefaces jar from the previous download section. :)

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

05 Jun 2009, 13:09

Thanks, you can grab the 0.9.0 snapshots from, there's no CI tool to build nightlies but we deploy it manually 3-4 times a week.

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

tatun78
Posts: 22
Joined: 04 Jun 2009, 13:32

08 Jun 2009, 13:20

Thanks for your reply.
I have downloaded the souce/.class files from snapshots and made a jar file from these classes. I put the jar in the lib file under my application's WEB-INF folder. However still now I could not make it.What I should do-please suggest.

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

08 Jun 2009, 14:01

The fix is checked in but a jar containing the fix is not deployed yet, please wait for tonight's build or build the lib from source. We've delayed the 0.9.0 release to 15th of june by the way.

tatun78
Posts: 22
Joined: 04 Jun 2009, 13:32

08 Jun 2009, 15:04

Thanks for reply. Ok so the patch release will be on or after 15th.
However the thing is that, in my project I am using the components provided by primefaces-ui-0.8.3.jar to build GUI.
Now as per discussion I have tried to build a jar from SNAPSHOT sources using Eclipse and deployed the same under lib directory. However this is not solving my problem. I think I am not in right direction. What should I do to make work the snapshot classes in the 0.9.0.waiting eagerly for an early reply from you!!!
:?

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

08 Jun 2009, 16:07

hi tatun, yes the sources you use are old I guess, stay tuned for now(a couple of hours I guess), we'll deploy the latest version of the 0.9.0-SNAPSHOT and let you know :)

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

08 Jun 2009, 20:01

Snapshot by 8 june is built and deploy, you can grab it at;

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

This hopefully fixes the tree server side events.

anjan
Posts: 4
Joined: 08 Jun 2009, 14:02

09 Jun 2009, 09:46

Hi Cagatay

I tried building a tree component using the code given in the Primefaces "feature showcase demo".
The tree was successfully built but the various "possible node click events" viz. onNodeSelect, onNodeExpand & onNodeCollapse were not being fired properly.
The event onNodeExpand was fired once, but after expansion and subsequent collapse of a particular node, the onNodeExpand was not working. And the other events onNodeSelect & onNodeCollapse were not working at all.

I was following these posts' for the past few days and was eagerly waiting to get a solution for the tree node event listeners not working. I downloaded the 0.9.0-SNAPSHOT stuffs and made a .jar. Still the tree events are not working properly. Could you please help me regarding how to trap the tree node events viz. onNodeSelect, onNodeExpand & onNodeCollapse?

Following is the excerpt of the code which I used:

.jsp file
<p:tree value="# {treeBean.model}" toggleMode="async" nodeSelectListener="# {treeBean.onNodeSelect}"
nodeExpandListener="# {treeBean.onNodeExpand}" nodeCollapseListener="# {treeBean.onNodeCollapse}">
</p:tree>

Java Class

@Controller(name="treeBean", scope=Scope.SESSION)
public class TreeBean {

private static final Logger logger = LoggerFactory.getLogger(TreeBean.class);

private TreeNode root;

public TreeBean() {
root = new TreeNode("Root");
TreeNode node0 = new TreeNode("Node 0");
TreeNode node1 = new TreeNode("Node 1");
TreeNode node2 = new TreeNode("Node 2");

TreeNode node00 = new TreeNode("Node 0.0");
TreeNode node01 = new TreeNode("Node 0.1");

TreeNode node10 = new TreeNode("Node 1.0");
TreeNode node11 = new TreeNode("Node 1.1");

node00.addChild(new TreeNode("Node 0.0.0"));
node00.addChild(new TreeNode("Node 0.0.1"));
node01.addChild(new TreeNode("Node 0.1.0"));

node10.addChild(new TreeNode("Node 1.0.0"));

node0.addChild(node00);
node0.addChild(node01);

node1.addChild(node10);
node1.addChild(node11);

root.addChild(node0);
root.addChild(node1);
root.addChild(node2);
}

public TreeNode getModel() {
return root;
}

public void onNodeSelect(NodeSelectEvent event) {
String node = event.getTreeNode().getData().toString();
System.out.println("Selected:" + node);
}

public void onNodeExpand(NodeExpandEvent event) {
String node = event.getTreeNode().getData().toString();
System.out.println("Expanded:" + node);
}

public void onNodeCollapse(NodeCollapseEvent event) {
String node = event.getTreeNode().getData().toString();
System.out.println("Collapsed:" + node);
}
}

Waiting for an early reply from you, since I am stuck very badly :(
Thanks in advance!!

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 60 guests