• 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

create Richface Tree using JAXB API

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have to create richfaces tree. I am using JAXB api for reading xml & create java Object, now I am creating XmlNodeData object and filling it. when I view output on UI, tree is not generating..

TreeNode rootNode = new TreeNodeImpl();
XmlNodeData xmlNodeData = new XmlNodeData();
xmlNodeData.setName("manoj");
xmlNodeData.setNamespace("Sahal");
xmlNodeData.setAttribute("name", "Sahal");
xmlNodeData.setAttribute("action", "ACTIOn");


TreeNode node1 = new TreeNodeImpl();
node1.setData(xmlNodeData);
rootNode.addChild(new Integer(0), node1) ;


XmlNodeData xmlNodeDat1 = new XmlNodeData();
xmlNodeDat1.setName("manoj");
xmlNodeDat1.setNamespace("Sahal");
xmlNodeDat1.setAttribute("name", "Sahal");
xmlNodeDat1.setAttribute("action", "ACTIOn");

TreeNodeImpl child = new TreeNodeImpl();
child.setData(xmlNodeData);
rootNode.addChild(new Integer(1), child) ;

UI Code

<rich:tree id="treeXML" value="#{simpleTreeBean.treeNode}" var="vardata" style="width:300px" ajaxSubmitSelection="true" switchType="client" nodeSelectListener="#{simpleTreeBean.processSelection}" reRender="selectedNode" treeNodeVar="xnd" >

<rich:treeNode >
<h:outputText value="#{vardata.attributes['name']}" ></h:outputText>
<h:outputText value="#{vardata.attributes['id']}" > </h:outputText>
<h:outputText value=" #{vardata.text}" />
</rich:treeNode>

If any one know .. Please help me..

 
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
Welcome to the JavaRanch, Manoj!

It has been a while, but I believe that RichFaces has a way of dynamically generating tree nodes from POJOs without all that complicated JSF-specific code. I had a similar app where there was a 3-level menu 2-3 years back, and while I have forgotten the details, the basics are documented (although not as well as I'd like) in the RichFaces online documentation.
 
Manoj Sahal
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Issue resolved thanks ..):
 
reply
    Bookmark Topic Watch Topic
  • New Topic