• 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
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

Is it possible to use List<java Object> and bind it to my rich:tree rather than List<Sring>?

 
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is one main question here, and then others that are followups depending on the answer to this, so I will ask the big question first -

Is it possible to use Collections that are loaded with java Objects rather than String variables to bind to my rich:tree? I know I can bind a List loaded with String values to my tree and have it display, but can I use a List that is loaded with java Objects and have it also display a tree somehow?

If you don't understand what I am trying to ask just read on

I have been looking at various things, and so far all I have been able to get to display a tree is a List full of String values.

Now if I load this List with the actual java Object itself, including all the variables within that Object of course, where the tree should be is a blank space. There may be a problem with how I am doing my rich:tree tag attributes and such so my first question is - if I have a List loaded with java Objects, and those Objects have two String variables - name and device, is there a way to bind this List to a rich:tree, and have it use the name String variable as the root and the device String variable as the nodes under each root? I have tried many variations but there are just so many different ways to try this I figured it would be better to ask here and hope someone answers.

And, if that is not possible, I was also looking at the TreeNodeImple data type. Now in the examples I have seen it uses String values like this:




but is it possible to replace String with my Project Object and still have that work (like I have been trying to do with List), like this:



And if so, then the same question I had for the List data type, how can I bind this to the rich:tree correctly so it uses the name String variable from Project as the root and the device String variable as the node?

But all this hinges on the question, is it possible to use Collections loaded with Objects rather than Strings as the variable I bind to the rich:tree?


edit - here is an idea of how I have been trying to bind this stuff to my jsf page (projectTreeNode is a TreeNodeImpl data type):

 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have not used rich:tree, but I am doing a similar thing with rich:dataTable. So long as the <Object> has explicit getters and setters, it will simply work. So in your example, "Project" would need to have a public "getName()" and "getDevice()".

What you cannot seem to do is pass parameters into the EL #{project.value('something')}. There may be a way around this, but I have not needed to investigate it.

J.
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well if it is possible, then the problem is how I am binding it to the rich:tree tag. I will just have to keep trying different variations till it works I guess
 
Or we might never have existed at all. Freaky. So we should cherish everything. Even this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic