Tree with no children!!

hi,
I hav a tree in my (Client/Server)application wherein I inserted dummies as children for the tree nodes that show at one point of time..
However when the treeWillExpand comes..when the user expands it.........I get the next level children for that node.
now the problem is when there ain't no children (in which case too I am inserting dummy children just to allow the user to expand..not knowing prior to expansion that there are no children)....i wanted that the expandable state should not be shown for a node which has no children.........
Can this be done....?
Is there another way to do that.... but insert dummy nodes?

hi laura
i think the first error occurs if u have the cursor set to a different item in a different block other than tree or u called a set_tree_node call to a value of node thats not been assigned at all.
null

Similar Messages

  • Create report of Chart of account tree with account balance in Crystal

    Hello everyone
    I need to know is there is a way to make a report in crystal showing the chart of accounts and the balance for each account including the grouping accounts with his balance, is there a way to display the account tree in crystal??
    The problem I face is how to display the grouping accounts each one with his children under and to summarize the amounts all of his children. And for all the levels of the tree
    Thanks in advance for your help
    Best Regards

    what has been changed. Did the query actually change ?
    Nothing on query. I have removed some nodes from the hierarchy. After updating the crystal report I am able to see the changes in hierarchy structure in report. But list of values which were available before are missing. I tried uploading the list of values by pointing appropriate database field, still it failed to upload the list of values for the those parameters(prompts)
    Thanks
    Raghu

  • Problem when expanding Tree - Tree with nested table column

    Hi, i have created the tree using the Tree with nested table column.
    I have created a node called TREE_ROOT in the context.
    This node has few attributes which includes children_loaded, is_leaf, is_expanded.
    I have created the recursive node TREE_SUB for the above node TREE_ROOT.
    In the view, i have created the table with the master column. The above attributes have been mapped accordingly. I have created the action handler for load_children.
    In this action handler method, i receive the context_element correctly. In this method, i determine the children of the selected element and the resulting children are attached to this context_element.
    But the problem is: when i add elements to context_elements in the method load_children, these
    elements get added to the node TREE_ROOT as well.
    Please help.
    thanks and best regards,
    Pramod

    I just use some types defined in this user... Well, I hope you know what is the type definition of d_period_sec,
    don't you ? I didn't ask to provide all types existed now, only types you are
    using.
    Anyhow you have been granted with execute privilege for types you are using:
    SQL> conn tau_tll/tau_tll;
    Connected.
    SQL> create or replace type d_period_sec as object (date# date);
      2  /
    Type created.
    SQL> grant execute on d_period_sec to public with grant option;
    Grant succeeded.
    SQL> conn scott/tiger
    Connected.
    SQL> CREATE OR REPLACE TYPE unit_function AS OBJECT (
      2  xi NUMBER,
      3  yi NUMBER,
      4  xe NUMBER,
      5  ye NUMBER,
      6  xm NUMBER,
      7  ym NUMBER,
      8  v NUMBER,
      9  a NUMBER,
    10  f NUMBER,
    11  descr VARCHAR2 (20)
    12  );
    13  /
    Type created.
    SQL> grant execute on unit_function to master;
    Grant succeeded.
    SQL> CREATE OR REPLACE TYPE unit_moving_point AS OBJECT
      2  (
      3  p tau_tll.d_period_sec, -- from user TAU_TLL
      4 
      5  m unit_function
      6  )
      7  /
    Type created.
    SQL> grant execute on unit_moving_point to master;
    Grant succeeded.
    SQL> CREATE OR REPLACE TYPE moving_point_tab AS TABLE OF unit_moving_point;
      2  /
    Type created.
    SQL> grant execute on moving_point_tab to master;
    Grant succeeded.
    SQL> CREATE OR REPLACE TYPE moving_point AS OBJECT (u_tab moving_point_tab);
      2  /
    Type created.
    SQL> grant execute on moving_point to master;
    Grant succeeded.
    SQL> conn master/master
    Connected.
    SQL> CREATE TABLE MPOINTS (
      2  id NUMBER,
      3  mpoint scott.Moving_Point)
      4  NESTED TABLE mpoint.u_tab store as moving_tab;
    Table created.Rgds.

  • ADF Tree with Self Join

    Hi,
    I want to make an application using component tree with one table. This table has menu_id and menu_parent.
    I got a little problem when I use self joining table, it shown all parents and children.
    I want only the root folder (parent) to be shown first and then by opening the menu_parent, i should be able to see the menu_id folders.
    Can you please help me.
    Thanks

    Hi,
    you need to have a viewcriteria in your vo for selecting the parents one, then while selecting vo in datacontrols in AM you need to select your viewcriteria in your vo by editing it.
    Also you need to have a ViewLink between same viewobjects i.e menu_id->parent->id.
    See if this helps.
    Regards,
    Santosh,

  • Traversing a tree with breadthFirstEnumeration

    Hi all,
    I'm trying to traverse a DefaultMutableNode tree using breadthFirstEnumeration. However, while traversing I need to remove some branches and continue with the Enumeration.
    Do you know any way to preserve the Enumeration after removing a branch???
    For example:
    for(Enumeration en = trial.breadthFirstEnumeration(); en.hasMoreElements() ;) {
                   DefaultMutableTreeNode currentNode = (DefaultMutableTreeNode)en.nextElement();
                   if((String)currentNode.getUserObject() == "2") {
                        ((DefaultMutableTreeNode)(currentNode)).removeAllChildren();
                   System.out.println((String)currentNode.getUserObject());
    This code traverses a tree with depth 3 and branching factor 3. In the meanwhile it removes node 2's children.
    However the otuput is
    0 1 2 3 4 5 6
    instead of: 0 1 2 3 4 5 6 10 11 12
    I'd be very grateful if someone can help me.
    Regards,
    Pesho

    This is how it usually is done.
    Start with an empty map, e.g. HashMap. The map has e.g. company name as key, and company as value.
    Start traversing, and do a lookup towards the map when you find a company reference. Use the company within the map if there is one, and create a new company and place it in the map if it doesn't exist. Populate the companies within the map with information when you bump into them during traversal.
    The map will contain fully populated companies when the traversal is completed, and all companies will reference the same instances since you always are checking the map.
    Kaj

  • What about Bug  - FRM-47316: Branch nodes with no children are not allowed

    Hi friends,
    I've just executed another inherited application (Win XP, forms 6i, client/server)..and.. the first on the screen:
    FRM-47316: Branch nodes with no children are not allowed
    The application has a "tree menu".. I supose the problem appears when it's trying to load menu nodes...
    I've searched in metalink, and it only appears a post (483897.995) saying that this is a bug, but...I can't understand if it's already solved in Forms 6i
    Any ideas?
    Thanks,
    Jose.

    Hi friends,
    I've just executed another inherited application (Win XP, forms 6i, client/server)..and.. the first on the screen:
    FRM-47316: Branch nodes with no children are not allowed
    The application has a "tree menu".. I supose the problem appears when it's trying to load menu nodes...
    I've searched in metalink, and it only appears a post (483897.995) saying that this is a bug, but...I can't understand if it's already solved in Forms 6i
    Any ideas?
    Thanks,
    Jose.

  • Programatically creating ADF Tree with nodes,child nodes & links?

    Hi,
    Currently I am using Build JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660. Please provide me detailed code for programatically creating ADF Tree with nodes, child nodes and links in it.
    Thanks,
    Vik

    You need to create a model for the tree. ADF has a build in model that you can use to build your own tree.
    This is what you need to write in your JSPX:
    <af:tree summary="Navigation" id="treeNav" value="#{pageFlowScope.treeNavigationBackingBean.model}"
               var="node" contextMenuSelect="true" rowSelection="single" fetchSize="30">   
           <f:facet name="nodeStamp">
          <af:outputText id="txtText" value="#{node.text}"/>
        </f:facet>
    </af:tree>This is the code to retreive the model:
      public TreeModel getModel() {
        if(model == null)
            model = new ChildPropertyTreeModel(instance,"children");
        return model;
      }instance contains the actual tree. I build it in the constructor of my managed bean:
        public BeanTreeNavigation() {
          ArrayList<TreeItem> rootItems = new ArrayList<TreeItem>();
          TreeItem node1 = new TreeItem("Root node");
             ArrayList<TreeItem> level1 = new ArrayList<TreeItem>();
             TreeItem level1Node1 = new TreeItem("Level1 Node1");
              level1.add(level1Node1);
           node1.setChildren(level1);
           rootItems.setChildren(node1); 
          this.setListInstance(rootItems);
          root = rootItems;
      public void setListInstance(List instance) {
        this.instance = instance;
        model = null;
      }The TreeItem class is not a default one. I created it myself. You can make of it whatever you want:
        public class TreeItem {
          private String text;
           private List<TreeItem> children = null;
           public TreeItem(String text){
            this.text = text;
            public void setText(String text) {
                this.text = text;
            public String getText() {
                return text;
            public void setChildren(List<TreeItem> children) {
                this.children = children;
            public List<TreeItem> getChildren() {
                return children;
            }I wrote the TreeItem as an inner class of the managed bean.
    The most important part is the getModel methode. There you need to specify an Object and the name of the getter that will return a List of the children.
    Hope this helps.
    Edited by: Yannick Ongena on Feb 22, 2011 7:30 AM

  • Hiding nodes in a tree keeping the children visible

    I have a tree with a dataprovider which takes the following form:
    <details name="Cars">
        <contact_person>aaaa</contact_person>
        <list>
            <car type="A">
                <car name="A1"/>
                <car name="A2"/>
            </car>
            <car type="B">
                <car name="B1"/>
                <car name="B2"/>
            </car>
        </list>
    </details>
    I want the tree to be shown like this
    Cars
         A
              A1
              A2
         B
              B1
              B2
    That is I want to hide the contact_person and list nodes.Deleting the nodes from the dataprovider cannot be done.So what i did was to create a custom tree data descriptor by extending DefaultDataDescriptor.Then override the getChildren method and applied a filterfunction to the collection returned by super.getChildren.The problem is when i hide the 'list' node I cannot have the child nodes to show up.So is there any way I can hide 'list' but show the children of 'node'?

    I think in getChildren, you want to return car and not list.

  • How to build a BIG TREE with Tree-Form layout

    Hi,
    I do have a self-referenced table with our org structure - 15 000 positions.
    I do want to create a tree with this structure.
    Requirements :
    a, to have a tree-form layout
    b, to have search capabilities
    I have tried to use several combinations (maybe all)
    - from using only one View object and create recursive tree - doesn't even run
    - to use two View objects, first as top level nodes, the other as the rest - it runs
    but I can search only top level, and what is worse, by clicking on the node for showing additional information (tree-form layout) I'm waiting for ages for seeing the info
    (it seems that all records are loaded one by one into AS)
    Could you provide some ideas how to deal with this ?
    Thanks.

    I am sorry, this is beyond the scope of this forum.
    As with any functionality not directly provided by JHeadstart, you can build it yourself using the ADF design time tools in JDeveloper. Please use the JDeveloper forum for help on this first step.
    Then, to keep your pages generatable you can move these customizations to custom templates. We are happy to help you with this last step, should you have problems there.
    Steven Davelaar,
    JHeadstart Team.

  • HT201269 Hi. I have shared an Apple ID with my children for some time.  As they are getting older they do not wnat me seeing all their messages, photos etc so want their own accounts.  How can they access their purchased music and apps on the new account

    Hi. I have shared an Apple ID with my children for some time.  As they are getting older they do not wnat me seeing all their messages, photos etc so want their own accounts.  How can they access their purchased music and apps on the new account please?

    Yes.
    On their iOS devices, under Settings>iTunes & App Store, they should use your Apple ID. When they log into iCloud, iMessage and Facetime, they should use their personal Apple IDs.

  • Using depth first traversal to add a new node to a tree with labels

    Hello,
    I'm currently trying to work my way through Java and need some advice on using and traversing trees. I've written a basic JTree program, which allows the user to add and delete nodes. Each new node is labelled in a sequential order and not dependent upon where they are added to the tree.
    Basically, what is the best way to add and delete these new nodes with labels that reflect their position in the tree in a depth-first traversal?
    ie: the new node's label will correctly reflect its position in the tree and the other labels will change to reflect this addition of a new node.
    I've searched Google and can't seem to find any appropriate examples for this case.
    My current code is as follows,
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.tree.*;
    public class BasicTreeAddDelete extends JFrame implements ActionListener
        private JTree tree;
        private DefaultTreeModel treeModel;
        private JButton addButton;
        private JButton deleteButton;
        private int newNodeSuffix = 1;
        public BasicTreeAddDelete() 
            setTitle("Basic Tree with Add and Delete Buttons");
            DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode("Root");
            treeModel = new DefaultTreeModel(rootNode);
            tree = new JTree(treeModel);
            JScrollPane scrollPane = new JScrollPane(tree);
            getContentPane().add(scrollPane, BorderLayout.CENTER);
            JPanel panel = new JPanel();
            addButton = new JButton("Add Node");
            addButton.addActionListener(this);
            panel.add(addButton);
            getContentPane().add(panel, BorderLayout.SOUTH);
            deleteButton = new JButton("Delete Node");
            deleteButton.addActionListener(this);
            panel.add(deleteButton);
            getContentPane().add(panel, BorderLayout.SOUTH);    
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            setSize(400, 300);
            setVisible(true);
        public void actionPerformed(ActionEvent event) 
            DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
            if(event.getSource().equals(addButton))
                if (selectedNode != null)
                    // add the new node as a child of a selected node at the end
                    DefaultMutableTreeNode newNode = new DefaultMutableTreeNode("New Node" + newNodeSuffix++);
                      treeModel.insertNodeInto(newNode, selectedNode, selectedNode.getChildCount());
                      //make the node visible by scrolling to it
                    TreeNode[] totalNodes = treeModel.getPathToRoot(newNode);
                    TreePath path = new TreePath(totalNodes);
                    tree.scrollPathToVisible(path);               
            else if(event.getSource().equals(deleteButton))
                //remove the selected node, except the parent node
                removeSelectedNode();           
        public void removeSelectedNode()
            DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
            if (selectedNode != null)
                //get the parent of the selected node
                MutableTreeNode parent = (MutableTreeNode)(selectedNode.getParent());
                // if the parent is not null
                if (parent != null)
                    //remove the node from the parent
                    treeModel.removeNodeFromParent(selectedNode);
        public static void main(String[] arg) 
            BasicTreeAddDelete basicTree = new BasicTreeAddDelete();
    }      Thank you for any help.

    > Has anybody got any advice, help or know of any
    examples for this sort of problem.
    Thank you.
    Check this site: http://www.apl.jhu.edu/~hall/java/Swing-Tutorial/Swing-Tutorial-JTree.html

  • Problem in using AdvanceDataGrid as tree with drag n drop functionality

    Hi All,
    I am using AdvancedDataGrid as tree for displaying my data. Within this ADG tree I have to enable drag n drop i.e. user can select one node and will able to drop that on another node within tree.
    Overwritten dragDrop handler event for ADG.
    Issues: Not getting target node on which I am dropping currently selected node.

    Please don’t use this forum for support questions, go use flexcoders or the Adobe forums instead.
    Matt
    On 2/10/09 11:21 PM, "rakess" <
    [email protected]> wrote:
    A new discussion was started by rakess in
    Developers --
      Problem in using AdvanceDataGrid as tree with drag n drop functionality
    Hi All,
    I am using AdvancedDataGrid as tree for displaying my data. Within this ADG tree I have to enable drag n drop i.e. user can select one node and will able to drop that on another node within tree.  
    Overwritten dragDrop handler event for ADG.
    Issues: Not getting target node on which I am dropping currently selected node.
    View/reply at Problem in using AdvanceDataGrid as tree with drag n drop functionality <
    http://www.adobeforums.com/webx?13@@.59b7e11c>
    Replies by email are OK.
    Use the unsubscribe <
    http://www.adobeforums.com/webx?280@@.59b7e11c!folder=.3c060fa3>  form to cancel your email subscription.

  • Problem in Tree with in a table

    Hi Experts,
    I have created a WDC which contains the tree with in a table.
    I have created a table in the view and a Master column in it.
    Initially i loaded the tree with some values in my WDDOINIT of my view.
    I have also created the event handler for that Master column i.e., OnLoadChildren event handler.
    I have written some code in it, so that this event handler method will be called when i try to expand a node in the table.
    Unfortunately, the debugger is not getting in to that method, and that event is not being called when i Expand the tree node in the table.
    Please suggest me so that i can complete the assignment.
    Thanks in advance and for all the help given till now.

    Hi
    You can join a hierarchical query as you suggest; you can also use SYS_CONNECT_BY_PATH() to identify the subproduct. Here's the kind of query you need - I've used the HR sample data, but you should be able to transform this into products, subproducts etc
    select subproduct.first_name, subproduct.last_name, part.job_id, sum(part.salary), count(distinct part.employee_id)
    from employees subproduct
    left join (
    select level lev
         , sys_connect_by_path(last_name,'/') reportsto
         , sys_connect_by_path(to_char(employee_id,'fm0000'),'/') ancestors
         , substr(sys_connect_by_path(to_char(employee_id,'fm0000'),'/'),7,4) subprodid
         , emp.*
    from employees emp
    start with employee_id = 100 -- like identifying the product
    connect by prior employee_id = manager_id
    ) part
    on part.subprodid = to_char(subproduct.employee_id,'fm0000')
    where subproduct.manager_id=100
    group by subproduct.first_name, subproduct.last_name, part.job_idYou'll see I've used a fixed format connect_by_path (with 4 digits per level) which makes it easy to pull out the second level.
    HTH
    Regards Nigel

  • How to create  a very simple dyamic tree with rich faces

    hi i have spent more than 5 days trying to make a very simple rich faces tree but with no result
    i want to make a very simple dyamic tree
    for example i have a button when i click it.i want to add two nodes in my tree("node 1" and "node 2")
    i have also failed in making even a static tree with richfaces i think that some thing is wrong with them i checked the live demo website
    http://livedemo.exadel.com/richfaces-demo/richfaces/tree.jsf?c=tree
    i have tried the source code but with no result :(
    thank you

    You can try something like this
    <rich:tree switchType="server" >
    <rich:treeNodesAdaptor nodes="#{CB.calendarioHandler.organizacion.departamentos}"
    var="departamento">
    <rich:treeNode>
    <h:outputText value="#{departamento.nombre}"/>
    </rich:treeNode>
    <rich:treeNodesAdaptor nodes="#{departamento.empleados}"
    var="empleado">
    <rich:treeNode>
    <h:outputText value="#{empleado.nombre}"/>
    </rich:treeNode>
    <rich:treeNodesAdaptor nodes="#{empleado.calendarios}"
    var="calendario">
    <rich:treeNode>
    <h:outputText value="#{calendario.nombre}"/>
    </rich:treeNode>
    </rich:treeNodesAdaptor>
    </rich:treeNodesAdaptor>
    </rich:treeNodesAdaptor>
    </rich:tree>
    where departamentos, empleados and calendarios are just simple pojos lists.
    I hope to help.
    Edited by: sfdgd on Apr 1, 2009 6:40 PM

  • How to duplicate a node along with its children in a JTree?

    Hello,
    Can anyone tell me how to duplicate/create a copy of a node
    along with its children?
    Code snippets will be appreciated.
    Thank you.

    It cant be done . You have to write a z pogram to update the data in the new dbtable.

Maybe you are looking for

  • Downloading data from a BLOB Field using mod_plsql

    Hi, I am trying to use the mod_plsql to download data from a blob field, I have a web page where I can pick the file name to be downloaded from the documents table This table has the BLOB field that has the Data formatted in a text file format(contai

  • Mapping Error in CAF

    Hi there, when creating CAF Application services with custom operations, the added input parameters are treated as optional. This becomes obvious when researching the generated WSDL (Expose as web service) ---> maxOccurs=1, minOccurs=0. Now, if tryin

  • Files open using Notepad o always in minimized size

    All of a sudden, when I open a file using note pad, it always open in minimized size, I have to give an extra click to maximaze it. I searched on line, and tried something like to setup in Notepad property window, in run field , set it to normal. Or

  • No iSight camera in Vista?

    i installed windows vista using boot camp 2.0 and i installed the drivers for the leopard install disc it all works fine but i can't find the camera i looked in the device manager and its there its working but when i got to My computer there is no ca

  • Can I open and use a downloaded Excel Spreadsheet?

    Can I open and use a downloaded Excel Spreadsheet? <Re-Titled By Host>