MyFaces Tree Component Rendering

Hi all,
I am adding myfaces client tree Component to my panel.Its not rendering and its throwing exception.
anyhelp would be appriciated
Thanks
Sudha

Hi,
I am trying to render myfaces client tree on faces portlet using RAD 6.0. As RAD does not support JSF 1.1, I have commented DOCTYPE from faces-config.xml in tomahawk.jar file.
Root of the tree is getting displayed without "+" sign. And when I click on it,
javascript error "Object Expected" occurs.
I am not able to figure out the problem from last 2 days. So, Please help me out if you can.
Thanks in anticipation.
~Madhura

Similar Messages

  • A tree component

    Hello,
    I'm presently looking for a JSF tree component. I need one which not only would allow me to display a little icon next to my leaves names, but which would allow me to display a checkbox too.
    I've tried the Apache MyFaces tree, in the Tomahawk sub-project. But it looks like I won't manage to add a checkbox without changing its code.
    A clue, anyone ? With MyFaces or anything else ?
    AlienQueen

    below is my code from my project
    perhaps it is useful for your problem
    * Copyright 2005 The Apache Software Foundation.
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
    * http://www.apache.org/licenses/LICENSE-2.0
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
    package com.itlt.clb.action;
    import org.apache.myfaces.custom.tree2.HtmlTree;
    import org.apache.myfaces.custom.tree2.TreeNode;
    import org.apache.myfaces.custom.tree2.TreeNodeBase;
    import org.apache.myfaces.custom.tree2.TreeModel;
    import org.apache.myfaces.custom.tree2.TreeModelBase;
    import com.itlt.clb.entity.Agency;
    import com.itlt.clb.util.HibDb;
    import com.itlt.clb.util.Loginer;
    import com.itlt.clb.util.constant.ConstParas;
    import javax.faces.context.FacesContext;
    import javax.faces.application.FacesMessage;
    import javax.faces.component.UIComponent;
    import javax.faces.validator.ValidatorException;
    import javax.faces.event.ActionEvent;
    import java.io.Serializable;
    import java.util.List;
    * Backer bean for use in example. Basically makes a TreeNode available.
    * @author Sean Schofield
    * @version $Revision: 1.9 $ $Date: 2007-05-31 09:17:44 $
    public class TreeBacker implements Serializable
    private TreeModelBase _treeModel;
    private HtmlTree _tree;
    private boolean select;
    public boolean isSelect() {
              return select;
         public void setSelect(boolean select) {
              this.select = select;
         public TreeNode getTreeData()
              String formatFolder = "foo-folder";
              int agencyCodeLen = 5;//代理编码长度
              long agencyId = Loginer.getCurLogin().getUserclerk().getAgency().getId();
              TreeNode treeData = null;
              //首先得到中港通的数据.
              List chinaLinkList = HibDb.queryHQL("from Agency a where a.id ='"+agencyId+"' and a.status = '"+ConstParas.common3Status.ACTIVE.getStatus()+"'", 0, 0);
              Agency chinaLinkAgency = null;
              if(chinaLinkList != null && chinaLinkList.size() > 0){
                        chinaLinkAgency = (Agency)chinaLinkList.get(0);
                        if(chinaLinkAgency.getCode().length()==agencyCodeLen)
                             formatFolder = "foo-folder";
                        else
                             formatFolder = "bar-folder";
                        treeData = new TreeNodeBase(formatFolder, "<input type='checkbox' id='agency_"+chinaLinkAgency.getId()+"' value='"+chinaLinkAgency.getId()+"' onclick='getSelectAgency(this)'>"+chinaLinkAgency.getName()+"", false);
              // construct a set of fake data (normally your data would come from a database)
              List list = HibDb.queryHQL("from Agency a where a.agency.id='"+chinaLinkAgency.getId()+"' and a.status = 'A'", 0, 0);
              Agency agency = null;
              Agency subAgency = null;
              Agency subAgencyPoint = null;
              TreeNodeBase personNode = null;
              TreeNodeBase folderNode = null;
              TreeNodeBase folderNodePoint = null;
              for(int i=0;i<list.size();i++){
                   agency = (Agency)list.get(i);
                   if(agency.getAgency() != null){
                        if(agency.getCode().length()==agencyCodeLen)
                                       formatFolder = "foo-folder";
                                  else
                                       formatFolder = "bar-folder";
                        personNode= new TreeNodeBase(formatFolder, "<input type='checkbox' id='agency_"+chinaLinkAgency.getId()+"_"+agency.getId()+"' value='"+agency.getId()+"'onclick='getSelectAgency(this)'>"+agency.getName()+"", false);
                        //&#21435;&#25214;&#21040;&#25152;&#26377;&#23646;&#20110;&#23427;&#30340;&#38144;&#21806;&#28857;
                        //System.out.println(" agency.getId() = "+agency.getId());
                             List subList = HibDb.queryHQL("from Agency a where a.agency.id = '"+agency.getId()+"'and a.status ='"+ConstParas.common3Status.ACTIVE.getStatus()+"'", 0, 0);
                             for(int k=0;k<subList.size();k++){
                                  subAgency = (Agency)subList.get(k);
                                  if(subAgency.getCode().length()==agencyCodeLen)
                                            formatFolder = "foo-folder";
                                       else
                                            formatFolder = "bar-folder";
                                  folderNode = new TreeNodeBase(formatFolder, "<input type='checkbox' id='agency_"+chinaLinkAgency.getId()+"_"+agency.getId()+"_"+subAgency.getId()+"' value='"+subAgency.getId()+"'onclick='getSelectAgency(this)'>"+subAgency.getName()+"", false);
    //                              folderNode.getChildren().add(new TreeNodeBase("document", "X050001", true));
    //                              personNode.getChildren().add(folderNode);
                                  List subListPoint = HibDb.queryHQL("from Agency a where a.agency.id = '"+subAgency.getId()+"' and a.status = '"+ConstParas.common3Status.ACTIVE.getStatus()+"'", 0, 0);
                                  for(int l=0;l<subListPoint.size();l++){
                                       subAgencyPoint = (Agency)subListPoint.get(l);
                                       if(subAgencyPoint.getCode().length()==agencyCodeLen)
                                                 formatFolder = "foo-folder";
                                            else
                                                 formatFolder = "bar-folder";
                                       folderNodePoint = new TreeNodeBase(formatFolder, "<input type='checkbox' id='agency_"+chinaLinkAgency.getId()+"_"+agency.getId()+"_"+subAgency.getId()+"_"+subAgencyPoint.getId()+"' value='"+subAgencyPoint.getId()+"'onclick='getSelectAgency(this)'>"+subAgencyPoint.getName()+"", true);
                                       folderNode.getChildren().add(folderNodePoint);
    //                                        personNode.getChildren().add(folderNode);
                                  personNode.getChildren().add(folderNode);
                        treeData.getChildren().add(personNode);
    return treeData;
    * NOTE: This is just to show an alternative way of supplying tree data. You can supply either a
    * TreeModel or TreeNode.
    * @return TreeModel
    public TreeModel getExpandedTreeData()
    return new TreeModelBase(getTreeData());
    public void setTree(HtmlTree tree)
    _tree = tree;
    public HtmlTree getTree()
    return _tree;
    public String expandAll()
    _tree.expandAll();
    return null;
    private String _nodePath;
    public void setNodePath(String nodePath)
    _nodePath = nodePath;
    public String getNodePath()
    return _nodePath;
    public void checkPath(FacesContext context, UIComponent component, java.lang.Object value)
    // make sure path is valid (leaves cannot be expanded or renderer will complain)
    FacesMessage message = null;
    String[] path = _tree.getPathInformation(value.toString());
    for (int i = 0; i < path.length; i++)
    String nodeId = path;
    try
    _tree.setNodeId(nodeId);
    catch (Exception e)
    throw new ValidatorException(message, e);
    if (_tree.getNode().isLeaf())
    message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
    "Invalid node path (cannot expand a leaf): " + nodeId,
    "Invalid node path (cannot expand a leaf): " + nodeId);
    throw new ValidatorException(message);
    public void expandPath(ActionEvent event)
    tree.expandPath(tree.getPathInformation(_nodePath));
    it support your checkboxi
    Message was edited by:
    lysmart

  • Label display issue in Tree component when it is having vertical scrollbar

    I am using tree component as dropdown factory for combo box. When i open dropdown, it doesn't have vertical scrollbar and all the root nodes are getting displayed correctly(in closed mode). Now if i try to open any node, i am getting vertical scrollbar as the child nodes are more. Now the problem is if scroll down, some of the nodes(labels) are not getting displayed but i am able to see the icon. If i keep on scrolling bottom to top and top to bottom, some of the nodes are showing labels and some are not(It is inconsistant).
    I have not used any custom item renderer for tree control. I used my custom dataDescriptor which i have implemented from ITreeDataDescriptor. Also I tried extending DefalutDataDescriptor, but no luck.

    Does it work if the tree is not in a combobox?

  • How to modify a tree component dinamically

    Hi to everybody. I'm a problem with RichTree component when I try to run my application in jdeveloper 11g.
    In jsp page I have a RichInputText and a button component. When you click on the button, it modifies one String type variable: it stores the same value of RichInputText component.
    After that the applicatiion should show a tree that use the modified variable before, but when I click on the button an exception occurs:
    javax.faces.el.EvaluationException: java.lang.NullPointerException
         at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:51)
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
         at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:458)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:763)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:640)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:275)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:175)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at oracle.adf.share.http.ServletADFFilter.doFilter(ServletADFFilter.java:61)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:85)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:279)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:239)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:196)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:139)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:149)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: java.lang.NullPointerException
         at view.Tree_1.search(Tree_1.java:55)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
         at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
         at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:46)
         ... 34 more
    I show the code in the following lines:
    Sense represents the tree nodes.
    ----------------------------------Sense.java
    public class Sense {
    private String _name = null;
    private List<Sense> _kids = null;
    public Sense(String name){
    setName(name);
    public String getName(){ return _name;}
    public void setName(String name){this._name = name;}
    public List<Sense> getKids(){ return _kids;}
    public void setKids(List<Sense> kids){this._kids = kids;}
    -----------------------------------Tree_1.java
    public class Tree_1{
    private Object _instance = null;
    private transient TreeModel _model = null;
    private String _key;
    private RichInputText inputText1;
    public RichInputText getInputText1(){return this.inputText1;}
    public void setInputText1(RichInputText inputText){
    this.inputText1 = inputText;
    public Tree_1() {
    ArrayList<Sense> root = new ArrayList<Sense>();
    Sense senso = new Sense(_key);
    root.add(senso);
    ArrayList<Sense> firstSon = new ArrayList<Sense>();
    Sense senso2 = new Sense(_key+"2");
    firstSon.add(senso2);
    senso.setKids(firstSon);
    this.setListInstance(root);
    public TreeModel getModel() throws IntrospectionException {
    if (_model == null) {
    model = new ChildPropertyTreeModel(instance, "kids");
    return _model;
    public void setListInstance(List instance) {
    _instance = instance;
    _model = null;
    public String search() {
    _key = inputText1.getValue().toString();
    return null;
    -------------------------------------SenseView.jsp
    <af:form>
    <af:inputText label="Label 1" id="inputText1"/>
    <af:commandButton text="commandButton 1" action="#{Tree_1.search}"/>
    <af:tree var="node" value="#{Tree_1.model}"
    inlineStyle="width:100%; height:100%;">
    <f:facet name="nodeStamp">
    <af:outputText value="#{node.name}" />
    </f:facet>
    <f:facet name="pathStamp"/>
    </af:tree>
    </af:form>
    Any ideas? thank's a lot

    Hi,
    what is the scope of the bean ? the command button performs a page reload after which the key is empty again
    Frank

  • How to display multiple JComponents in a tree cell renderer

    I have an object in a tree cell renderer and want to display its members(three members) status in a JTree as checkboxes such that each node displays three checkboxex with member-names and a node name. i tried using a JPanel and adding three labels into this panel to be returned for the cell renderer but the GUI fails to paint the node componnents. However on clicking the node the component which isn't visible displays correctly. please Help me out

    Since you didn't provide any sample code, it's all about wild guesses on what your problem is. The following code shows the type of program you could have posted :import javax.swing.*;
    import javax.swing.tree.*;
    import java.awt.*;
    public class TestTree extends JPanel {
         private static class MyCell {
              String theCellName;
              boolean theFirstField;
              boolean theSecondField;
              boolean theThirdField;
              public MyCell(String aName, boolean firstField, boolean secondField, boolean thirdField) {
                   theCellName = aName;
                   theFirstField = firstField;
                   theSecondField = secondField;
                   theThirdField = thirdField;
         private static class MyTreeCellRenderer extends JPanel implements TreeCellRenderer {
              private JLabel theCellNameLabel;
              private JCheckBox theFirstCheckBox;
              private JCheckBox theSecondCheckBox;
              private JCheckBox theThirdCheckBox;
              private DefaultTreeCellRenderer theDelegate;
              public MyTreeCellRenderer() {
                   super(new GridLayout(4, 1));
                   theCellNameLabel = new JLabel();
                   add(theCellNameLabel);
                   theFirstCheckBox = new JCheckBox("firstField");
                   add(theFirstCheckBox);
                   theSecondCheckBox = new JCheckBox("secondField");
                   add(theSecondCheckBox);
                   theThirdCheckBox = new JCheckBox("thirdField");
                   add(theThirdCheckBox);
                   theDelegate = new DefaultTreeCellRenderer();
                   setOpaque(true);
              public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected,
                                                                       boolean expanded, boolean leaf, int row, boolean hasFocus) {
                   if (!(value instanceof DefaultMutableTreeNode)) {
                        return theDelegate.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
                   Object userObject = ((DefaultMutableTreeNode)value).getUserObject();
                   if (!(userObject instanceof MyCell)) {
                        return theDelegate.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
                   setBackground(tree.getBackground());
                   if (selected) {
                        setBorder(BorderFactory.createLineBorder(Color.BLUE, 2));
                   } else {
                        setBorder(BorderFactory.createLineBorder(getBackground(), 2));
                   MyCell cell = (MyCell)userObject;
                   theCellNameLabel.setText(cell.theCellName);
                   theFirstCheckBox.setSelected(cell.theFirstField);
                   theSecondCheckBox.setSelected(cell.theSecondField);
                   theThirdCheckBox.setSelected(cell.theThirdField);
                   return this;
              public Component add(Component comp) {
                   if (comp instanceof JComponent) {
                        ((JComponent)comp).setOpaque(false);
                   return super.add(comp);
         public TestTree() {
              super(new BorderLayout());
              JTree tree = new JTree(createModel());
              tree.setShowsRootHandles(true);
              tree.setCellRenderer(new MyTreeCellRenderer());
              add(new JScrollPane(tree), BorderLayout.CENTER);
         private static final TreeModel createModel() {
              DefaultMutableTreeNode root = new DefaultMutableTreeNode(new MyCell("root", true, true, true));
              DefaultMutableTreeNode child1 = new DefaultMutableTreeNode(new MyCell("child1", false, true, false));
              DefaultMutableTreeNode child2 = new DefaultMutableTreeNode(new MyCell("child2", false, false, true));
              root.add(child1);
              root.add(child2);
              return new DefaultTreeModel(root);
         public static void main(String[] args) {
              final JFrame frame = new JFrame("Test");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setContentPane(new TestTree());
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        frame.setSize(600, 400);
                        frame.show();
    }

  • Incremental Loading of a Tree Component

    I'm working on an explorer-type interface in Flex 2 for
    browsing a remote file repository. It's a standard split-pane
    affair with a directory tree on the left and a listing on the
    right.
    Because the entire directory tree can be rather large, I need
    to load it incrementally as the user expands nodes rather than all
    at once. I failed to find a relevant example so I wrote my own. It
    works, but I'm new to Flex and am not sure if there's an easier way
    or if there are any pitfalls to the way I did it.
    I posted my code here:
    http://xocoatl.blogspot.com/2007/01/incremental-loading-of-tree-in-flex-2.html
    Any comments here or on the blog are appreciated; I'm
    guessing that having a good example of the "right" way to do this
    will be useful to many others.
    Thanks.

    i am also using another workaround using CSS trick(inlineStyle). if #{node.children} is null, i am placing an empty 10x10 white png image file over expand icon on tree node.
    following code is nodeStamp of tree component.
    <f:facet name="nodeStamp">
      <af:group id="g1">
        <af:image source="/images/spacer.png" id="i1" inlineStyle="border: 2px solid white; position: absolute; margin-left:-14px;" rendered="#{node.children == null}"/>
        <af:commandLink text="#{node.name}" id="cl1" partialSubmit="true"/>
      </af:group>
    </f:facet>

  • Tree component bug (?) and some questions

    Hi! I have some problems and questions about tree component.
    Problems:
    1. I have an expanded tree with ~300 items. Each item label
    displayed in 2-3 strings. After QUICK tree scrolling using mouse
    wheel (I make 3-5 scrolls) for most of items displayed only last
    string and one empty string :(
    Bug of tree renderer? Is it fixable?
    Questions:
    1. Can I have font color X for tree item 1 and font color Y
    for tree item 2?
    2. I have a tree with ~300 items. Expand/Collapse tree
    operations takes 5 to 10 seconds on Core2Duo. Is it possible to
    speed up this operations?
    Code:

    Hello.
    About problem 1.
    I faced this problem several times, cann't understand the
    problem. May be it's a bug.
    Questions.
    1. Of course you can. Write itemRenderer for this.
    2. Tree has effects for expanding and collapse events, you
    can reduce times for them.

  • Tree component problem

    The follow Exception is threw if I put a Tree component in any page in one of my project :
    java.net.MalformedURLException: no protocol: /layout/layout.dtd
    stack trace:
    java.net.MalformedURLException: no protocol: /layout/layout.dtd     
    at com.sun.rave.web.ui.renderer.template.xml.XMLLayoutDefinitionManager.getLayoutDefinition(XMLLayoutDefinitionManager.java:194)     at com.sun.rave.web.ui.component.TemplateComponentBase.getLayoutDefinition(TemplateComponentBase.java:150)     at com.sun.rave.web.ui.renderer.template.TemplateRenderer.encodeBegin(TemplateRenderer.java:73)     at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:683)     at javax.faces.webapp.UIComponentTag.encodeBegin(UIComponentTag.java:591)     at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:543)     at org.apache.jsp.index_jsp._jspx_meth_ui_tree_0(index_jsp.java:322)     at org.apache.jsp.index_jsp._jspx_meth_ui_form_0(index_jsp.java:256)     at org.apache.jsp.index_jsp._jspx_meth_ui_body_0(index_jsp.java:231)     at org.apache.jsp.index_jsp._jspx_meth_ui_html_0(index_jsp.java:169)     at org.apache.jsp.index_jsp._jspx_meth_ui_page_0(index_jsp.java:146)     at org.apache.jsp.index_jsp._jspx_meth_f_view_0(index_jsp.java:119)     at org.apache.jsp.index_jsp._jspService(index_jsp.java:89)     at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:336)     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:297)     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:247)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)     at sun.reflect.GeneratedMethodAccessor183.invoke(Unknown Source)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)     at java.lang.reflect.Method.invoke(Method.java:585)     at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)     at java.security.AccessController.doPrivileged(Native Method)     at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)     at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)     at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)     at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)     at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)     at java.security.AccessController.doPrivileged(Native Method)     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)     at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:723)     at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:482)     at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:417)     at org.apache.catalina.core.ApplicationDispatcher.access$000(ApplicationDispatcher.java:80)     at org.apache.catalina.core.ApplicationDispatcher$PrivilegedForward.run(ApplicationDispatcher.java:95)     at java.security.AccessController.doPrivileged(Native Method)     at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:313)     at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)     at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)     at com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.java:311)     at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)     at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:221)     at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)     at java.lang.reflect.Method.invoke(Method.java:585)     at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)     at java.security.AccessController.doPrivileged(Native Method)     at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)     at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)     at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)     at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)     at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)     at java.security.AccessController.doPrivileged(Native Method)     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)     at com.sun.rave.web.ui.util.UploadFilter.doFilter(UploadFilter.java:194)     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:210)     at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)     at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)     at java.security.AccessController.doPrivileged(Native Method)     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)     at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)     at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:189)     at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doProcess(ProcessorTask.java:604)     at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:475)     at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:371)     at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:264)     at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:281)     at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:83)
    Caused by: java.net.MalformedURLException: no protocol: /layout/layout.dtd     
    at java.net.URL.<init>(URL.java:567)     at java.net.URL.<init>(URL.java:464)     at java.net.URL.<init>(URL.java:413)     at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:968)     at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:905)     at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:872)     at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:282)     at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(XMLDocumentScannerImpl.java:1021)     at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)     at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)     at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)     at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)     at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:250)     at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:292)     at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:123)     at com.sun.rave.web.ui.renderer.template.xml.XMLLayoutDefinitionReader.read(XMLLayoutDefinitionReader.java:146)     at com.sun.rave.web.ui.renderer.template.xml.XMLLayoutDefinitionManager.getLayoutDefinition(XMLLayoutDefinitionManager.java:190)     ... 82 more
    Message was edited by:
    hugebrush
    Message was edited by:
    hugebrush

    hello
    you wrote:
    >>Problem above just occurs when the application runing in bundled Sun Application Server PE 8.2 ...
    How solve this problem with SAS PE8.2
    I tested my app (with tree component) in Tomcat, the app not functioned normally.
    I don't know, how solve this problem.
    I think, it's not correctly to edit the webui.jar file.
    See
    http://forum.sun.com/jive/thread.jspa?forumID=123&threadID=98154
    Thank you.

  • Tree component customization

    Hi all,
    I'm new to flex and having a hard time figuring out the best way to approach the following problem (in Flex context, _not_ AIR):
    I need a tree representation of some hierarchical/composite data structures as depicted below (for those familiar with XMLSpy, the diagram is similar to the XSD tree structure diagrams):                                                                                     |-------------|
                                                                                         | Child       |
                                                                                         | child info  |
                                          |------------------|                           |-------------|
                                       |--| Child            |--------- Choice (x) ------|
                                       |  | Child Info      (x)                          |-------------|
                                       |  --------------------                           | Child       |
                                       |                                                 | child info  |
    ---------------                    |  |------------------|                           |-------------|
    | Parent      |------ Sequence (x)-|--| Child            |
    | Parent Info (x)                  |   | Child Info     (x)
    ---------------                    |   --------------------
                                       |
                                       |  |------------------|
                                       |--| Child            |
                                          | Child Info      (x)
    The (x) in the picture are the collapse/expand buttons.
    What would be the best way to approach this project ?
    - Is it a customization of the standard Tree component + custom Tree Item Renderer ?
    - The nodes should be expandable/collapsible + selectable (additional information to be displayed on selection of node without expand/collapse effect)
    - For the nodes would it make sense to derive them from the ToggleButton ? (and what would be the most sensefull way of introducing the second line on the button ? Or just building a proper graphical component for it (derived from Group)?
    - What is the most effective way to deal with the balancing of the tree in such a way that subtrees move out of the way/in place on expand resp. collapse of nodes ? (through (H/V)groups ?)
    - What would be the most efficient way to deal with the connectors between nodes ?
    - dataprovider would be an XML structure - what is the best place to put the building algo ? (Every node know how to create itself and the first level children ? Or a tree traverse on the XML structure, building all components in one go ?)
    Any advice/thoughts/references are welcome !
    Thanks in advance,
    Best regards,
    Bart

    Sorry for the "text picture" - if you copy/paste it in word (with courier new font
    ), the picture becomes clear ;-)

  • JSF tree component

    Hello,
    I am using JSF 1.1
    + looking to add tree functionality to a couple of rows.
    I know that myfaces has it but would like to know if JSF 1.1 also have something similar to tree2 from myfaces.
    Thanks!

    The Sun RI of JSF does not have a tree component like MyFaces.
    You will either have to create your own custom tree component using the Sun JSF RI (could be a lot of work, especially if you've never created a custom component before), or use the MyFaces one.
    CowKing

  • Jdeveleoper- JSF- Tree component

    Hi,
    I am new to JSF and JDeveloper. I want to have a tree component using JSF. Any suggestions on how to create a tree component??
    regards,
    Meenakshi.S

    Hi, currently there is no JSF tree componenet. You can use ADF faces tree or
    myfaces tree2.

  • Error in t:tree component of tomahawk

    I am using tree component of tomahawk like this in my xhtml file
    <t:tree id="tree" value="#{treeBean.tree}"
    styleClass="tree"
    nodeClass="treenode"
    selectedNodeClass="treenodeSelected"
    expandRoot="true">
    </t:tree>
    and this is my class file,
    public class TreeBean
    private DefaultTreeModel tree;
    public DefaultTreeModel getTree() {
    return tree;
    public void setTree(DefaultTreeModel tree) {
    this.tree = tree;
    public TreeBean()
    DefaultMutableTreeNode root = new DefaultMutableTreeNode("XY");
    DefaultMutableTreeNode a = new DefaultMutableTreeNode("A");
    root.insert(a);
    DefaultMutableTreeNode b = new DefaultMutableTreeNode("B");
    root.insert(b);
    DefaultMutableTreeNode c = new DefaultMutableTreeNode("C");
    root.insert(c);
    DefaultMutableTreeNode node = new DefaultMutableTreeNode("a1");
    a.insert(node);
    node = new DefaultMutableTreeNode("a2 ");
    a.insert(node);
    node = new DefaultMutableTreeNode("b ");
    b.insert(node);
    a = node;
    node = new DefaultMutableTreeNode("x1");
    a.insert(node);
    node = new DefaultMutableTreeNode("x2");
    a.insert(node);
    tree = new DefaultTreeModel(root);
    but when i run my xhtml file, i am getting error like this,
    java.lang.NullPointerException
         at org.apache.myfaces.custom.tree.HtmlTree.addToModelListeners(HtmlTree.java:806)
    at org.apache.myfaces.custom.tree.HtmlTree.encodeBegin(HtmlTree.java:683)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:232)
         at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
         at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
         at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:580)
         at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
         at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:245)
         at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:50)
         at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:156)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:152)
         at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
         at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:217)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:197)
         at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:50)
         at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:156)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:152)
         at incture.view.SecurityFilter.doFilter(SecurityFilter.java:62)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
         at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:217)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:197)
         at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:50)
         at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:156)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:152)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Thread.java:595)
    How to solve this,
    Regars,
    Vinutha.

    Hi i have the same problem, Did you found a solution ?

  • Migration problem with Tree component (10.1.3.3 - 11.1.1.0)

    Hello,
    I'm trying to migrate an application from Jdev10.3.3 to Jdev11. In this application I wanted to handle the Tree State (tree navigation to a defined node) and persist it if needed (keep the tree to a certain state). To do this, I developed logic using:
    1) TreeModel class to handle the information of the tree (oracle.adf.view.faces.model)
    2) CoreTree class to handle the view part of the tree (oracle.adf.view.faces.component.core.data)
    3) PathSet class to build the navigation to the node I need (oracle.adf.view.faces.model)
    In the migration to Jdev11 I converted to this components:
    1) org.apache.myfaces.trinidad.model.TreeModel
    2) org.apache.myfaces.trinidad.component.core.data.CoreTree
    3) ?
    I don't know how to migrate the PathSet logic. In the Trinidad docs I didn't see a PathSet class neither a method like CoreTree.getTreeState(), so I suppose that this part of the Api has changed.
    Thanks for your attention.
    Antonio.

    I found an hint in the new WebDeveloper guide, section "10.5.4 What You May Need to Know About Programmatically Expanding and Collapsing
    Nodes".
    Apparently the class I need in the new version of the Tree is "oracle.adf.view.rich.model.RowKeySet".
    Probably, for migrating my application, I will have to rewrite my logic for handling the tree:(.
    Antonio

  • Custom icon per entry in the AS2 Tree Component (using CS3)

    I have a tree component that loads its data from an XML file and I wonder if I can customize every entry to have its own icon by adding an icon attribute to every entry in the XML and giving the tree an action to read that icon (which would exist in the library of the Flash file). My goal is to reproduce a tree within an application that my company is developing (it's for a training tool related to that application).
    My XML says something like <node label = 'Label' heading = 'LABEL' desc = 'Description' icon = 'icon1' />
    My label is what the tree displays, the heading is what the information dialog in the training tool displays as a title bar, the desc is what the training tool displays within the body of the text for the function description and the icon is what I want to be a reference to the graphic in the library to place as an icon in front of the item rather than use setStyle with the properties for disclosure, leaf, and folder icons.
    Is that possible? I haven't found a solution for it yet.

    I've never used the Tree component, so I'm just guessing here....
    There is a slight delay before the xml file loads and your tree has its data provider.
    Perhaps during that time there is no node at mTree.getTreeNodeAt(0) to open? Try adding this just before the last line of your code:
    trace("the node is: "+mTree.getTreeNodeAt(0));
    What do you get?
    You might need to move that code inside the xml's load event handler.
    Another thing is that the Flash components tend to work on an invalidate-then-wait-one-frame-to-redraw kind of model. So it is possible you will need to wait one frame after the xml has loaded and then tell it to open that node.
    The doLater method might help with that.
    var home:MovieClip=this;
    var xmlTreeData:XML = new XML();
    xmlTreeData.onLoad = function() {
    mTree.dataProvider = this.firstChild;
    mTree.doLater(home,"delay");
    xmlTreeData.ignoreWhite = true;
    xmlTreeData.load("xml/treeValues1.xml");
    mTree.setStyle("fontSize","11");
    mTree.setStyle("selectionColor","0xE0E0E0");
    mTree.setStyle("useRollOver",false);
    function delay(){ 

  • Layout issue with af:tree component

    I am using af:tree component but I am finding layout issue with it. I have a requirement where in I need the tree to stretch to the available space but a horizontal and a vertical scrollbar comes up automatically. Is there a way to handle this issue?

    User, without your jdev version it's hard to help.
    Have you embedded the tree component in a stretch layout?
    Timo

Maybe you are looking for