This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes Primefaces tree update Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Primefaces tree update" Watch "Primefaces tree update" New topic
Author

Primefaces tree update

timo talja
Greenhorn

Joined: Nov 19, 2013
Posts: 1
Hi,
just a basic question - gurus stand by for an answer a beginner can understand....
--> I have a menuitem tree view (T) and from that an dialog (D) can be opened. Great.
--> on that opened dialog user can submit a deletion where some of those original rows which appeared on that tree (T) existed are beeing erased.

Question - how on earth can I update that tree (T) on the backgroud when making actions with dialog (D) ? Or is it possible ?
- If simultaneous update on both T and D is impossible, how do I update T when exiting D ?

br,
timo
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2247
    
    7

Welcome to the Ranch

Are you sure you want to use a dialog? Isn't it possible to have the tree on one side and the editable content in a panel on the other side?

When changing the data in the panel the tree gets updated. Also the backing bean controls or manages when the tree gets refreshed (eg like every operation). For simplicity, the managed bean should be in ViewScope.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15960
    
  19

The dialog just needs to fire off an AJAX request that re-renders the underlying tree. The user's browser will handle the sordid graphical details automatically.

View Scope is OK, but more persistent scopes (such as session scope) are OK, too. Request Scope is useless. But then Request Scope is almost always useless no matter what you do in JSF. It doesn't provide a stable Model for the MVC mechanisms to use.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Primefaces tree update
 
Similar Threads
browse button
Issue for the time to lock
restoring and recalling a JTree
I have question about JFilechooser?
how to capture the action while clicking on the tree structure. (tomahawk tree component)