RichTree is not rendered properly when created in Managed Bean

HI,
I am trying to create af:tree in managed bean using RichTree. It is not rendering the tree nodes properly. It is only showing the nodes, node text is missing. I am using EL expression to show the value in node element. But when I am creating the af:tree in jspx page, it is working properly.
Following is the code,
JSPX Page ------------------------------------------------------------>
<?xml version='1.0' encoding='windows-1252'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<jsp:directive.page contentType="text/html;charset=windows-1252"/>
<f:view>
<af:document id="document1" title="Tree Test">
<af:form id="form1">
<af:panelGroupLayout layout="horizontal">
<af:spacer width="50" height="50"/>
<af:panelGroupLayout layout="vertical">
<h1>RCF Tree Component Test</h1>
<af:spacer height="10" width="10"/>
<h3>ADF Tree in JSPX</h3>
<af:spacer height="5" width="10"/>
<af:tree binding="#{treeTest.tree}" var="node" value="#{treeTest.treeModel}" rowSelection="multiple" rowDisclosureListener="#{treeTest.toggle}" selectionListener="#{treeTest.TableSelect}" inlineStyle="border:1px solid black;">
<f:facet name="nodeStamp">
<af:panelGroupLayout>
<af:image source="#{node.icon}" inlineStyle="margin-right:3px; vertical-align:middle; height:14px; width:16px;"/>
<af:outputText value="#{node.description}"/>
</af:panelGroupLayout>
</f:facet>
</af:tree>
</af:panelGroupLayout>
<af:panelGroupLayout layout="vertical">
<af:spacer height="65" width="10"/>
<h3>ADF Tree in UI Bean</h3>
<af:spacer height="5" width="10"/>
<af:tree binding="#{treeTest.treeInBean}" inlineStyle="border:1px solid black;"/>
</af:panelGroupLayout>
</af:panelGroupLayout>
</af:form>
</af:document>
</f:view>
<!--oracle-jdev-comment:auto-binding-backing-bean-name:treeTest-->
</jsp:root>
Managed Bean ------------------------------------------------------------>
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import javax.el.ExpressionFactory;
import javax.el.ValueExpression;
import javax.faces.context.FacesContext;
import oracle.adf.view.rich.component.rich.data.RichTree;
import oracle.adf.view.rich.component.rich.layout.RichPanelGroupLayout;
import oracle.adf.view.rich.component.rich.output.RichImage;
import oracle.adf.view.rich.component.rich.output.RichOutputText;
import org.apache.myfaces.trinidad.event.RowDisclosureEvent;
import org.apache.myfaces.trinidad.event.SelectionEvent;
import org.apache.myfaces.trinidad.model.ChildPropertyTreeModel;
import org.apache.myfaces.trinidad.model.TreeModel;
public class TreeTest {
private RichTree tree = new RichTree();
private TreeModel treeModel;
final public static String ROOT_DIR = ".";
private RichTree treeInBean = new RichTree();
public TreeTest() {
List nodes = new ArrayList();
FileNode rootNode = buildFileTree(ROOT_DIR);
nodes.add(rootNode);
treeModel = new ChildPropertyTreeModel(nodes, "children") ;
private void createTreeInBean(List rootNode){
ChildPropertyTreeModel l_model = new ChildPropertyTreeModel();
l_model.setChildProperty("children");
l_model.setWrappedData(rootNode );
treeInBean.setValue( l_model);
treeInBean.setRowSelection("multiple");
treeInBean.setVar( "node" );
RichOutputText comp = new RichOutputText();
FacesContext l_context = FacesContext.getCurrentInstance();
ExpressionFactory l_factory = l_context.getApplication().getExpressionFactory();
ValueExpression l_expression = l_factory.createValueExpression( FacesContext.getCurrentInstance().getELContext(),
"#{node.description}", String.class );
comp.setValueExpression( "value", l_expression );
RichImage img = new RichImage();
img.setInlineStyle("margin-right:3px; vertical-align:middle; height:14px; width:16px;");
ValueExpression l_expressionImg = l_factory.createValueExpression( FacesContext.getCurrentInstance().getELContext(),
"#{node.icon}", String.class );
//img.setValueExpression( "source", l_expressionImg );
img.setSource("images/img1.png");
RichPanelGroupLayout layout = new RichPanelGroupLayout();
//layout.getChildren().add( img);
//layout.getChildren().add( comp);
//treeInBean.getChildren().add( layout);
treeInBean.setNodeStamp( layout);
treeInBean.getNodeStamp().getChildren().add( img );
treeInBean.getNodeStamp().getChildren().add( comp );
private static FileNode buildFileTree(String dirpath) {
File root = new File(dirpath);
return visitAllDirsAndFiles(root);
private static FileNode visitAllDirsAndFiles(File dir) {
FileNode parentNode = process(dir);
if (dir.isDirectory()) {
String[] children = dir.list();
for (int i = 0; i < children.length; i++) {
FileNode childNode = visitAllDirsAndFiles(new File(dir, children));
parentNode.getChildren().add(childNode);
return parentNode;
public static FileNode process(File dir) {
FileNode node = new FileNode(dir);
return node;
public void TableSelect(SelectionEvent p_event) {
System.out.println(" Selection Event = " + p_event);
RichTree l_tree = (RichTree)p_event.getSource();
System.out.println("Display Row = " + l_tree.getSelectedRowKeys());
TreeModel model = ((ChildPropertyTreeModel)l_tree.getValue());
for (Object key : l_tree.getSelectedRowKeys()) {
model.setRowKey(key);
System.out.println("Model Data = " + ((FileNode)model.getRowData()));
public void toggle(RowDisclosureEvent p_rowDisclosureEvent) {
System.out.println(" Dislosure Event = " + p_rowDisclosureEvent);
public void setTree(RichTree tree) {
          this.tree = tree;
public RichTree getTree() {
return tree;
public void setTreeModel(TreeModel treeModel) {
this.treeModel = treeModel;
public TreeModel getTreeModel() {
return treeModel;
public void setTreeInBean(RichTree treeInBean) {
this.treeInBean = treeInBean;
public RichTree getTreeInBean() {
List nodes = new ArrayList();
FileNode rootNode = buildFileTree(ROOT_DIR);
nodes.add(rootNode);
createTreeInBean(nodes);
return treeInBean;
File Node Class-------------------------------------------------------------
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
public class FileNode {
private Collection children;
private boolean nodeSelected;
private File file;
public FileNode(File file) {
this.file = file;
children = new ArrayList();
public boolean isDir() {
return file.isDirectory();
public boolean isFile() {
return file.isFile();
public String getDescription() {
return file.getName();
public Collection getChildren() {
return children;
public String getIcon(){
if(children.size() == 0){
return "images/img1.png";
} else {
return "images/img3.png";
public int getChildCount() {
if (children == null)
return 0;
else
          return children.size();
public void setNodeSelected(boolean nodeSelected) {
this.nodeSelected = nodeSelected;
public boolean isNodeSelected() {
return nodeSelected;
public void setFile(File file) {
this.file = file;
public File getFile() {
return file;
@Override
public String toString() {
return getDescription();
With Regards,
Sujay

HI,
When you see the output of the code, you will find 2 different trees one with proper label and another with out labels. This tree is showing the folder structor. When i am creating the tree in managed bean, the EL expression of the component added in nodeStamp is not getting evaluated. To make sure that same component is stamped as nodeStamp, i tried by setting default value in that component, and it is showing the same hard coded value.
But the same EL expression is getting evaluated for the tree in JSPX page.
Sujay

Similar Messages

  • JButton not rendering properly when using JNI

    Hi,
    Has anyone ever invoked a JNI method through a java GUI only to find that the GUI is not properly repainting itself. In my case, my buttons become gray and the text becomes unbolded and blue. Its a very odd problem, isn't it? This occurs when I am porting Matlab code to C++ and then C++ to java. Any help that can help me proceed is appreciated!
    P.S. Could this have anything to do with Concurrency?
    Thanks.

    ejp wrote:
    So what does the JNU code do? Currently the code involves some Image Processing. But I'm certain what it does could not be the source of the problem as I have tried code as simple as y=x*10; in my Matlab compiled code.
    ejp wrote:
    and does anything else in the system wait for it? or synchronize against it? or join the thread you are starting? This code is dispatched by a background worker thread using an Executor object initialized by Executors.newFixedThreadPool(10). Originally it blocked the EDT. Nothing in my code has synchronous blocks or blocks (join) the thread I'm starting.
    jschell wrote:
    Stub out the JNI code. Have the methods do nothing or return a hard code reasonable data set.jschell, my method was to force the EDT to sleep for about 4 seconds, and then another test when I made it sleep for 30 seconds.
    When the thread stopped sleeping in both cases, no glitch was found. This suggests that the issue is in the JNI code. When I put a delay in the dispatched thread run() method, this delay was seen in the GUI. This tells me that the two threads were not completely separated, which would eventually causes a problem. Can someone tell me how to properly dispatch a thread from the GUI's EDT. I believe this would help me further. Does the SwingWorker class do this?
    Thanks.

  • Transitions not rendering properly - corruption

    My transitions are not rendering properly when I try layering two. It was working fine before, now suddenly it is not. I am using FCP 6 and I have Slick FX add ons. The add on was working fine before. I've tried trashing the FCP preferences but to no avail.
    See here for a sample -
    http://metrosi.com/Picture3.png
    Any other suggestions? Please help!
    Jennifer

    Seems that the problem is with specific Slick FX transitions. Ones under Slick FX Transitions - 3D.
    Things tried....
    Tried using the Rotate transition in another location, same issue. Looked ok in the timeline prior to rendering.
    There is a Slick FX transition in the timeline that appears to be rendering properly...Cylinder. Put another in a different part of the timeline and it rendered fine (Spin Zoom)
    Tried another 3D one (Spherize) -looks fine in the timeline before rendering...rendered fine.
    Tried another 3D one (Tube) - did not work.
    Tried adding Rotate in after adding others...still not working.
    Turnstile not working also (opened a new sequence and tried adding it)
    Twist not working either.
    So...not sure what to do about it!

  • I had designed a Web App and tested on Firefox 18, 19, 20 and now when i'm checking it on 21 version it's not rendering properly. Now tell me what should i do.

    I had designed a Web App and tested on Firefox 18, 19, 20 and now when I'm checking it on 21 version it's not rendering properly. Now tell me what should i do.

    Hi charlesmoizeau, why do you want to install Firefox 18? To be compatible with a particular website or add-on? There might be a better workaround, but without the details, it's hard to say.
    See this help article: [[Install an older version of Firefox]]. And be aware that Mozilla discloses [https://www.mozilla.org/security/known-vulnerabilities/firefox.html security flaws] after each new release.

  • Command links are not rendering properly in panel collection toolbar facet

    Hi
    I am using jdev 11.1.2.3.0
    I added toolbar component to the toolbar Facet of panel collection component .
    Under the tool bar I added two command link components with name create and delete,
    the problem is at run time the buttons are not rendering properly,they are hiding,instead of links
    this symbol(>>) is displaying.
    On clicking the symbol,I am able to see the links,I used <af:spacer> after the links but not worked.
    what I have to do to render the links properly in the panel collection toolbar facet

    Hi Timo
    This is the code and I am using 11.1.2.3.0
         <f:facet name="toolbar">
                    <af:toolbar id="t1">
                            <af:commandImageLink icon="#{resource['images:create.png']}" text="Create" id="cbInsert">
                            <af:showPopupBehavior popupId="p1"/>
                        </af:commandImageLink>
              </af:toolbar>

  • Command links are not rendering properly in the toolbar facet of panel collection

    Hi
    I am using jdev 11.1.2.3.0
    I added toolbar component to the toolbar Facet of panel collection component .
    Under the tool bar I added two command link components with name create and delete,
    the problem is at run time the buttons are not rendering properly,they are hiding,instead of links
    this symbol(>>) is displaying.
    On clicking the symbol,I am able to see the links,I used <af:spacer> after the links but not worked.
    what I have to do to render the links properly in the panel collection toolbar facet

    Hi Timo
    This is the code and I am using 11.1.2.3.0
         <f:facet name="toolbar">
                    <af:toolbar id="t1">
                            <af:commandImageLink icon="#{resource['images:create.png']}" text="Create" id="cbInsert">
                            <af:showPopupBehavior popupId="p1"/>
                        </af:commandImageLink>
              </af:toolbar>

  • CQ page is not rendering properly. It is not rendering HTML. It is showing HTML source code as is.

    On some of the pages, I am getting this weird behavior wherein page is not rendering properly. It is showing HTML source code as is. Could you please help me out? What could be the issue? And how can we get rid of the same?

    Check your component jsp page. it is possible that it is just plan file without directives <@ or you might have miss to close tag which is creating source as text to render
    Paste your jsp code in case you need further help
    Thanks,
    Ajit

  • Why do the youtube clips not expand properly when I double click on the page

    why do the youtube clips not expand properly when I double click on the page

    The exclamation mark is telling you that iPhoto has broken the file path/link to the original file. Assuming you're using iPhoto 9 or later Apply the two fixes below in order as needed:
    Fix #1
    1 - launch iPhoto with the Command+Option keys held down and rebuild the library.
    2 - run Option #4 to rebuild the database.
    Fix #2
    Using iPhoto Library Manager  to Rebuild Your iPhoto Library
    1 - download iPhoto Library Manager and launch.
    2 - click on the Add Library button and select the library you want to add in the selection window..
    3 - Now that the library is listed in the left hand pane of iPLM, click on your library and go to the Library ➙ Rebuild Library menu option.
    4 - In the next  window name the new library and select the location you want it to be placed.
    5 - Click on the Create button.
    Note: This creates a new library based on the LIbraryData.xml file in the library and will recover Events, Albums, keywords, titles and comments but not books, calendars or slideshows. The original library will be left untouched for further attempts at fixing the problem or in case the rebuilt library is not satisfactory.
    OT

  • Crystal report not rendering properly on Mozilla ?

    Hi,
    We are using VS2008,CR2008 on server 2012. In Chrome & IE CR working properly.
    But when I am using Mozilla with updated version not rendering properly.

    This is an old version of this issue that might give some insight:
    *[http://stackoverflow.com/questions/19768144/crystal-report-v10-5-toolbar-not-visible-on-firefox-but-visible-on-ie-and-chrome]
    also (but I am not sure what version you are using): " CR 10.5 is one of the versions that was not updated to support IIS7." from [http://www.experts-exchange.com/Database/Reporting/Crystal_Reports/Q_28350929.html]
    It might be ideal to ask a developer in stackoverflow.com or file a bug with webcompat.com for expert investigation for crystal reports. I am sorry I could not be more helpful.

  • PDFs not rendering properly with hpeprint or AirPrint

    Both my iPhone 4 and my iPad 2 connect to my LaserJet Pro 400 color MFP M475dn (connected via ethernet cable to an Apple Airport Extreme) and print most things just fine. However, when I use either hpeprint or Apple AirPrint options to attempt to print, PDFs are NOT rendered properly... the graphic logos appear ok on a PDF document, but text is a complete, incomprehensible mess. I have the latest firmware and software. Any ideas? Despite all the latest firmware and software, could it be a driver issue?Thanks in advance.

    Hi CTU_Agent, 
    Your LaserJet Pro 400 color MFP M475dn is a commercial product. I suggest posting in the forum for HP Business Support for a better chance at finding a prompt solution.
    You may find the commercial Laserjet board here.
    http://h30499.www3.hp.com/t5/Printers-LaserJet/bd-p/bsc-413
    Hope you find the help you need;
    RobertoR
    Remember ▼
    You can say THANKS by clicking the KUDOS STAR. If my suggestion resolves your issue Mark as a "SOLUTION" this way others can benefit Thanks in Advance!

  • Stylesheet not rendering properly on child site

    I have a stylesheet in the Style Library of a parent publishing site.  A Master Page in a child site is using the stylesheet, but the styles are not rendered properly.  I copied the same stylesheet and used it in an ASP.NET web form Master Page
    and the styles rendered properly.  I then created a basic HTML page and used that stylesheet and it worked out fine.  Why won't it work in SharePoint 2013?  Is there a clash with the default styles and can I disable the default styles?
    Thanks,
    Mike

    Hi,
    To use an External Stylesheet, you can reference it as what the links below suggests:
    http://techtrainingnotes.blogspot.jp/2012/05/adding-javascript-and-css-to-sharepoint.html
    https://www.nothingbutsharepoint.com/sites/eusp/Pages/Understanding-SharePoint-CSSLink-and-how-to-add-your-custom-CSS-in-SharePoint-2010.aspx
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • My Ipod touch does not work properly.When i charge it,it only works for 5 min.n gets discharge.I showed it to the apple store in banglore n the person told me its fine n It is working properly.Bt its not working properly.Can someone help

    My Ipod touch does not work properly.When i charge it,it only works for 5 min.n gets discharge.I showed it to the apple store in banglore n the person told me its fine n It is working properly.Bt its not working properly.Can someone help

    If after you charge it for about three hours and it only last about five minutes the battery is probably dead or there could be another hardware problem.  I would go back to the Apple store and ask them specifically how can it be OK if the fully charged battery only lasts five minutes.

  • Clip inspector in imovie not working properly - when I select a picture - and select clip adjustment it tells me that I need to select one or more clips to view Inspector tools and in a clip the audio adjustment only shows a speaker? help

    Clip inspector in imovie not working properly - when I select a picture (in project library) - and select clip adjustment it tells me that I need to select one or more clips to view Inspector tools and when I select a movie clip and then click on audio adjustments the audio adjustment appears as a speaker icon and I don't know how to get to the various audio options? It was working fine one minute and then I seemed to lose the functionality. Also editing a photo in a photo or getting rid of ken burns effect etc does not seem to work. help

    Can anyone shed any light on this as I am having the same problem? One minute it works fine, the next you get the error message above.
    Many thanks.

  • Hello My ipads Power button is not working properly when I press it once it shows option to turn off instead of locking and some other display problems like it suddenly lockes down or display disappears ...Please help. Thank You

    Hello My ipads Power button is not working properly when I press it once it shows option to turn off instead of locking and some other display problems like it suddenly lockes down or display disappears ...Please help. Thank You

    Thanks for that information!
    I'm sure I will be calling AppleCare, but the problem is, they charge for the phone calls don't they? Because I don't have money to be spending to be on the phone with a support service.
    In other things, it seemed like the only time my MacBook was working was when I had Snow Leopard without the 10.6.8 update download that was supposed to be done to prepare for OS X Lion.
    When I look at the information of my HD it says that I have 10.6.8 but that was the install that it claimed to have failed and caused me to restart resulting in all of the repeated problems.
    Also, because my computer is currently down, and I've lost all files how would that effect the use of my iPhone? Because if it doesn't get fixed by the time OS 5 is released, how would I be able to upgrade?!

  • My macbook pro is not working properly , when is turned on after then show apple logo and continue show this or nothing.

    my macbook pro is not working properly , when is turned on after then show apple logo and continue show this or nothing

    Gray, Blue or White screen at boot, w/spinner/progress bar

Maybe you are looking for

  • How can I display iPad on tv via apple tv.

    How can I display screen from iPad using apple tv?

  • Office Web Apps Error

    hi - I have Office Web Apps 2013 installed and configured on my dev server.  It's set to allow HTTP. When I try to preview a Word document, the frame displays the following message: This content cannot be displayed in a frame.  To help protect the se

  • Inbound IDoc w/message ORDERS - issues with error processing

    We are using inbound IDoc ORDERS05 with message type ORDERS to create the sales orders in SAP. In WE20 we have the following settings: - partner type LS (= Sales Org VKORG) - process code ORDE - trigger by background program - post-processing agent o

  • How to adjust mouse or trackpad parameters for the user selection screen?

    This is not critical, but annoying.  I can change the mouse or trackpad parameters by user, so anyone can use their own mouse or trackpad adjustment.  However I can not locate how to change this parameters for the welcome or user selection screen.  I

  • Dynamic table with JSF

    Hi, ALL! I need to create the dynamic table which should be able to automatically add th e rows after getting command from server without redrawing the whole page. Is it possible to do it with JSF ? Or I have to use smth else? Thank you