• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

rich:tree list order (leafs before nodes)

 
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
We are migrating to Richfaces 4 from Richfaces 3.3.2
We had a rich:tree which before, put leafs ahead of Nodes. This behavior has changed, as shown below:

-------------------------------------------------------
Before:
Root
---> Leaf A
---> Node 1
---------> Leaf B
---------> Leaf C
---------> Node 2

Now:
Root
---> Node 1
---> Leaf A
---------> Node 2
---------> Leaf B
---------> Leaf C
-------------------------------------------------------

We are using a rich:treeModelRecursiveAdaptor, and I have not been able to find a way to order the tree in the same way as was done before.

Any ideas?

Thanks,
Skip
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I mostly shy aware from trying to help people with JSF tree controls, since I've had enough trouble with them myself.

From the sound of it, however, you may need to keep a few basic concepts in mind. One of which is that the UI data model isn't necessarily the same thing as the problem domain data model.

The UI data model may reference a problem domain data model, but it might provide an altered aspect of the problem domain data model. For example, a list of names fetched from a database could be fronted by a UI data model list object whose elements are references to the database data model enumerated in reverse order. And, of course, for best results, that UI data model list object should in turn be fronted by a JSF DataModel object, if you want to exploit the full functionality of the JSF dataTable control.

In other words, if the data you have doesn't appear in the order or way you like, construct an appropriate UI data model from your base data and have the UI reference that.
 
Skip Cole
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Tim,

I've been trying to avoid altering with the domain data model, since this is only an upgrade, and I think that In Theory Richfaces 4 should be displaying this in the same way that Richfaces 3.32 did. But this is not the case.

I have started looking into how the data model is constructed, but haven't found a quick fix for this yet. If there is any parameter setting that will make the rich:tree 4.0 display like the rich:tree 3.3.2, that would be great.

Thanks again for getting back to me on this.

 
Tim Holloway
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just to clarify. The term "domain data model" is normally used to indicate the object model (ORM, JPA/Hibernate Entitites, etc.).

The point of the preceeding was that the domain data model itself is often not a good fit for the UI, in which case, you'd construct a separate UI model from the domain data model.

The UI model is ONLY used in the JSF MVC subsystem. The UI model itself never persisted. Although if the UI model is a collection of data model objects (for example, a tree of table rows), changes to the data model objects within the UI model may be persisted.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic