TreeNode ContextMenu

UI Components for JSF
Post Reply
dgbarber
Posts: 9
Joined: 19 Aug 2010, 01:03
Location: Northern Rockies, USA

29 May 2011, 04:06

I have been working with setting up ContextMenu's for specific node types on the Primefaces 3.0 Tree. That works well, but is there any way to get which specific node was clicked to show the menu? Right mouse clicking doesn't fire the selection event. Is there a onMouseOver event or something that will let me tell which specific node the menu was opened on? I have an IDE-like tree with projects that contain documents of different types. I would like to know which project or which document was right-clicked to produce the menu.

Thanks.
primefaces-3.0.RC1-SNAPSHOT, Mojarra 2.1.1, Glassfish 3.1.1, Tomcat 7, Netbeans 7.0.1

zerogravity
Posts: 4
Joined: 11 Aug 2011, 09:48

11 Aug 2011, 11:55

I am facing the same problem,is there anyway to detect which node in the tree was right clicked ?

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

11 Aug 2011, 13:37

There is onNodeClick on the client side passing you the node element container as a jQuery object.

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

11 Aug 2011, 14:00


zerogravity
Posts: 4
Joined: 11 Aug 2011, 09:48

11 Aug 2011, 15:42

Thanks Sir :D
you saved me :D

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

11 Aug 2011, 16:43

Hmm... But onNodeClick doesn't get business data from Java model (I think only toString() on TreeNode is called and passed to onNodeClick). And you set this issue http://code.google.com/p/primefaces/iss ... ail?id=856 to "Won'tFix". How can we get some data from Java model in order to distinguish between clicked nodes?
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

zerogravity
Posts: 4
Joined: 11 Aug 2011, 09:48

15 Aug 2011, 10:02

its a great work i ve downloaded "primefaces-3.0.M3-SNAPSHOT.jar" from repository and used it to run the tree with context menu using same example in PrimeFaces Labs.so when i delete node for the 1st time, it works just fine but when i try to delete node for the 2nd time it doesn't work and there is a javascript error
"Error: id.replace is not a function
Source File: http://localhost:8080/Facelet/javax.fac ... 3-SNAPSHOT
Line: 4"
so any help in that ?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

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