Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Primefaces tree update

 
timo talja
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3457
14
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Tim Holloway
Saloon Keeper
Pie
Posts: 18218
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic