How to open child node in Tree control?

Hi All,
I am using arrayCollection in my tree control.
I want to open one child node based on name of that node.
How to open that chid node?
I tried tree.OpenItems and ExpandItem methods. IT is not working. Any idea how to do it?

write this statement
TreeObject.expandItem("the branch",true)
But make sure you dont call this statement right after you set the dataProvider for the tree object. Instead wait for a second or two and then call this statement. This delay is allow the tree object ot call it validate functions.
Let me know if it helps

Similar Messages

  • How to add child node in Tree table programmetically

    Jdev Version 11.1.1.4.0.
    I have created tree table programmetically in bean.
    I have to add child node to tree table component on button click event on page.
    Please let me know how to do this in bean.
    Regards,
    Kiran

    How are you creating the tree pro-grammatically?
    If you are adding a new node to underlying data structure and refresh the tree - the tree will get updated with the new data.
    Thanks,
    Navaneeth

  • Don't see parent and child nodes in tree control with switcher, enclose xml

    Hi, i.m a novice for jdev 11.1.1.2,
    i need to create a tree menu, but when i put the switcher + n°2 face whith link object, inside the tree and
    run my application i don't see the node, but i see the bookmarks that collapease and expand Why ????
    Thanks for your help
    Gio
    enclose xml for better clarification:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1">
    <af:messages id="m1"/>
    <af:form id="f1">
    <af:panelStretchLayout id="psl1">
    <f:facet name="center">
    <af:panelGroupLayout layout="scroll"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    id="pgl4">
    <af:panelSplitter id="ps1" splitterPosition="156"
    inlineStyle="width:534px;">
    <f:facet name="first">
    <af:panelGroupLayout layout="scroll"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    id="pgl3">
    <af:panelHeader text="panelHeader 1" id="ph1">
    <f:facet name="context"/>
    <f:facet name="menuBar"/>
    <f:facet name="toolbar"/>
    <f:facet name="legend"/>
    <f:facet name="info"/>
    <af:tree value="#{bindings.DepartmentsViewTree.treeModel}"
    selectionListener="#{bindings.DepartmentsViewTree.treeModel.makeCurrent}"
    rowSelection="single" id="t1" var="node">
    <f:facet name="nodeStamp">
    <af:switcher id="s1"
    facetName="#{node.hierType.viewDefName}">
    <f:facet name="DepartmentsView">
    <af:panelGroupLayout id="pgl1">
    <af:commandLink text="#{node}"
    action="#{MainPageBean.departmentRegionLayout}"
    id="cl1">
    <af:setActionListener from="#{node.DepartmentId}"
    to="#{pageFlowScope.TreeKey}"/>
    </af:commandLink>
    <af:commandLink text=" (Edit)"
    action="createEdit" id="cl2">
    <af:setActionListener from="#{node.DepartmentId}"
    to="#{pageFlowScope.DeptTreeKey}"/>
    </af:commandLink>
    </af:panelGroupLayout>
    </f:facet>
    <f:facet name="EmployeesView">
    <af:commandLink text="#{node}"
    action="#{MainPageBean.employeeRegionLayout}"
    id="cl3">
    <af:setActionListener from="#{node.EmployeeId}"
    to="#{pageFlowScope.TreeKey}"/>
    </af:commandLink>
    </f:facet>
    </af:switcher>
    </f:facet>
    </af:tree>
    </af:panelHeader>
    </af:panelGroupLayout>
    </f:facet>
    <f:facet name="second">
    <af:panelGroupLayout layout="scroll"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    id="pgl2">
    <af:region value="#{bindings.dynamicRegion1.regionModel}"
    id="dynam1" partialTriggers="::t1"/>
    </af:panelGroupLayout>
    </f:facet>
    </af:panelSplitter>
    </af:panelGroupLayout>
    <!-- id="af_one_column_stretched" -->
    </f:facet>
    </af:panelStretchLayout>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    Edited by: user595664 on 5-dic-2009 2.54
    Edited by: user595664 on 5-dic-2009 2.57

    Hi,
    you need to provide the full naming for the facet names. So instead of DepartmentsView you provide mypackage.DepartmentsView where you replace mypackage with the package structure of the the ViewObject
    Frank

  • How to get each node in tree?

    how to get each node in tree?
    Message was edited by:
    NikisinProblem

    how to get each node in tree?
    Since (as far as I know) treeNode is an interface, the real question to me is how are you implementing your treeNodes? Are you overriding the toString() method?

  • Save selected node in Tree control

    I'm making this flex form for my school to add a new student
    to the DB. When the admin clicks on a button it will open a Tree
    control that displays the available courses and sections in the
    following heirarchy:
    Year>Semester>Course Name>Sections
    Now I want that when he clicks on the button Select within
    this new window showing the Tree, it will store the current
    selected node and the full path to it, so that back in the original
    form it will display the Year, Semester, Course name and section.
    I've tried using the value and selecteditem methods from the tree
    control but they are not working. Any ideas to figure out the full
    path of the selected item?

    You will need to climb back up the ancestor nodes to build
    that path yourself.
    "parent()" i believe returns the parent of the current node.
    Tracy

  • How to change font size of tree control content programati​cally

    Hi,
    Can I programtically change the font size of  parent item and child item in the tree control.
    In my application the parent and child items are changing  programatically. ie the content of tree control is not constant it is  dynamic.
    I am using labview 8.6
    Thank You
    Assumptha.
    Solved!
    Go to Solution.

    That does work...  
    To keep this line of instruction under the same title, how do you change ALL the text?  not just the active cell?  i've tried double clicking, then editing text properties using the font dialog (ctrl + 0) on a non-running vi, then saved it, and hit run.  but it always reverts to some preset font properties values, and i don't know where they're being set....???
    Any help would be greatly apprec! 

  • Problem in delting child node from tree

    Hello friends I have a problem in tree component
    I am using Xml File with creator .
    I am showing company name as a root node
    then department name as a child of company name
    then employee name as a child of department
    Initialy its working fine ,user can add edit and delete any node
    In add and edit option I have no problem but in delete I hava a problem
    when I am deleting any child node and after deleting the node I am clicking on the root node of the deleted node the it gives me null pointer Ecxeption .
    but user added any child node and then delete it then Application work properly .
    What is the problem I can't Understand please help me
    thanks
    Raviraj Gangrade

    thanks deepsix for helping me
    it gives me java.lang.NullPointerException and class name is
    net.sf.saxon.dom.NodeWrapper$ChildEnumeration
    here is my Stack Trace
    javax.faces.FacesException: #{Graphs.childNode_action}: javax.faces.el.EvaluationException: java.lang.NullPointerException
    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:78)
    at com.sun.rave.web.ui.appbase.faces.ActionListenerImpl.processAction(ActionListenerImpl.java:57)
    at javax.faces.component.UICommand.broadcast(UICommand.java:312)
    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
    at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:307)
    at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:79)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:221)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
    at sun.reflect.GeneratedMethodAccessor270.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 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: javax.faces.el.EvaluationException: java.lang.NullPointerException
    at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:130)
    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)
    ... 44 more
    Caused by: java.lang.NullPointerException
    at pegasusweb.Graphs.childNode_action(Graphs.java:1075)
    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 com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
    ... 45 more
    |#]
    [#|2006-11-30T14:51:30.000+0530|SEVERE|sun-appserver-pe8.2|javax.enterprise.system.container.web|_ThreadID=16;|StandardWrapperValve[Faces Servlet]: Servlet.service() for servlet Faces Servlet threw exception
    com.sun.rave.web.ui.appbase.ApplicationException: #{Graphs.childNode_action}: javax.faces.el.EvaluationException: java.lang.NullPointerException
    at com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.destroy(ViewHandlerImpl.java:601)
    at com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.java:302)
    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.GeneratedMethodAccessor270.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 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: javax.faces.FacesException: #{Graphs.childNode_action}: javax.faces.el.EvaluationException: java.lang.NullPointerException
    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:78)
    at com.sun.rave.web.ui.appbase.faces.ActionListenerImpl.processAction(ActionListenerImpl.java:57)
    at javax.faces.component.UICommand.broadcast(UICommand.java:312)
    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
    at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:307)
    at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:79)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:221)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
    ... 36 more
    Caused by: javax.faces.el.EvaluationException: java.lang.NullPointerException
    at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:130)
    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)
    ... 44 more
    Caused by: java.lang.NullPointerException
    at pegasusweb.Graphs.childNode_action(Graphs.java:1075)
    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 com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
    ... 45 more
    |#]

  • How to design a listbox or tree control related to the database

    Now i have a problem to design a listbox or tree control, it is designed to connect to the database, if the related element in database changed, the element in listbox or tree control should also change. i have managed to read the element in database, but i cannot input it to the listbox or tree control, since it has no input terminal that i can only use the Labeling tool and enter text into it.
    is there any advise on it, maybe i can use another control rather than listbox or tree control. any suggestion would be appreciate.
    Thank you
    XuY

    Hi Xuy,
          On the front-panel, right-click on the text-ring control and select: Create\Property Node.
    Then, on the diagram, right-click on the property-node and select "Strings[]".
    The "strings[]" property is the array of strings available in the control - and you can change it.
    Cheers!
    Message Edited by tbd on 04-05-2007 11:18 PM
    "Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
    Attachments:
    RingStrings.jpg ‏6 KB

  • How do you clear out a tree control?

    I am editing items in a tree control, when the editing is complete, I re-build the tree to represent what I have after the edit.  My process of deleting the items one-by-one has worked fine until the tree scrolled off the top, then, when I select the top-left item and delete everything under it, I miss the ones that have scrolled off the top.
    What's the method/property I should use to clean out a tree in one operation?  (before rebuilding)
       ...Dan

      Tray Drool!
    Originally I had, "How do you clear out a tree?".  That's why I added "control".

  • How create Nested Child Nodes in XML Forms

    Hello All:
                        I am very new to XML Forms/KM. I am trying to figure out a way to create Nested Child Nodes schema in XML Forms. Is there a way we can do it?
    Thanks and Regards,
    Vasu.

    Document document;
    NodeList[] dataNodeList=new NodeList[2];
    NodeList nodeList=document.getElementsByTagName("MyData");
    for(int i=0; i<nodeList.getLength(); i++)
    dataNodeList=nodeList.getChildNodes();

  • How to create a Child node in Tree object

    Hi All,
    I have a thought to create a tree with a child object, that the child can able to create through by right click the parent tree having the options to create or delete the child objects.Please Suggest me if  there is an possible way.
    Thanks
    Gopinath

    Look at sample programm BCALV_TREE_DEMO,
    and especially at the methods ADD_NODE or  DELETE_SUBTREE of class CL_GUI_ALV_TREE.
    For implementing the context menu, consider event ITEM_CONTEXT_MENU_REQUEST.
    Regards,
    Ulrich

  • Can't get child node in tree selection listener

    I am making a fusion web application using JDeveloper 11G (11.1.1.2.0).
    I have created two view objects linked together. Let's call them VoDepartments and VoEmployees, linked on DepartmentId.
    I hava made a tree with a af:switcher
    <af:switcher id="s1" facetName="#{node.hierType.structureDefName}">
    <f:facet name="view.VoDepartments">
      <af:outputText value="#{node}" id="ot1"/>
    </f:facet>
    <f:facet name="view.VoEmployees">
      <af:outputText value="#{node}" id="ot2"/>
    </f:facet>
    </af:switcher>I made a selection listener based on a guide by Frank Nimphius
    RichTree tree1 = (RichTree) selectionEvent.getSource();
    RowKeySet rks2 = selectionEvent.getAddedSet();
    Iterator rksIterator = rks2.iterator();
    if (rksIterator.hasNext()){
      List key = (List)rksIterator.next();
      JUCtrlHierBinding treeBinding = null;
      treeBinding = (JUCtrlHierBinding) ((CollectionModel)tree1.getValue()).getWrappedData();
      JUCtrlHierNodeBinding nodeBinding = nodeBinding = treeBinding.findNodeByKeyPath(key);
      String nodeStuctureDefname = nodeBinding.getHierTypeBinding().getStructureDefName(); //Here is the nullpointerexception for employees
      String employees = "view.VoEmployees";
      String departments = "view.VoDepartments";
      if (nodeStuctureDefname.equalsIgnoreCase(departments)){
       String dept = (String) nodeBinding.getAttribute("Department_name");  
       System.out.println("Department = "+dept);
      else if (nodeStuctureDefname.equalsIgnoreCase(employees)){
       String emp = (String) nodeBinding.getAttribute("First_name");  
       System.out.println("Employee = "+emp);
      else{
       //what the heck did the user click on? Ask him ;-)
    }Pagedef:
    Executables:
    <iterator Binds="VoDepartments2" RangeSize="25" DataControl="AppMainDataControl" id="VoDepartments2Iterator"/>
    Bindings:
    <tree IterBinding="VoDepartments2Iterator" id="VoDepartments2">
    <nodeDefinition DefName="view.VoDepartments" Name="VoDepartments20">
      <AttrNames>
       <Item Value="DepartmentId"/>
      </AttrNames>
      <Accessors>
       <Item Value="VoEmployees"/>
      </Accessors>
    </nodeDefinition>
    <nodeDefinition DefName="view.VoEmployees2" Name="VoDepartments21">
      <AttrNames>
       <Item Value="First_name"/>
       <Item Value="Last_name"/>
      </AttrNames>
    </nodeDefinition>
    </tree>The tree works just fine and list all it should list. I can click the department and my selection listener print the departments name in the console.
    I can expand a department and list all employees. The problems is when I click an employee, I get null pointer exception.
    I have found out that the selectin listener can't find nodeBiding for employees. So nodeBinding.getHierTypeBinding().getStructureDefName(); throw NullpointerException.
    Anyone have an idea of what's wrong? Please help.
    -Thomas
    Edited by: Thomas H on Mar 22, 2010 8:21 AM

    Hi,
    if you open the tree binding editor, it has an entry "Target Data Source" for each of the node levels that you can use and point to an iterator binding representing the node. Not sure if this solves the issue, but chaces are.
    1. create an iterator for a child VO (using the not dependent child VO instance)
    2. Edit Target Data Source for the binding to e.g. ${bindings.EmployeesView1Iterator}
    Frank

  • How to create multi node /data Tree by using few loops or small code

    HI.
    I WANT TO CREATE A TREE WHICH IS HAVING MULTI NUMBER OF NODE LEVEL (USER HAVE THE ABILITY TO CREATE AS MANY AS REQUIRED NODE LEVEL OR SUBLEVEL). HOW CAN I POPULATE THE TREE WITH SMALL CODE. AS EVERY NODE LEVEL NEED ON NESTED LOOP. SO HOW CAN I MANAGE TO POPULATE THE NODE WITH FEW LOOPS. OR THERE IS ANY OTHER WAY TO MANAGE THIS PROBLEM.
    THANKS

    Hi ,
    I am trying to do the job , but i do not understand where
    is the problem with my loop , i am sending it , could you
    see it , and sujjest me , what to do. or if you have time
    can you write the code for me. as i am very much needy for
    this job.
    The Table is as:-
    CREATE TABLE TREE_01(
    RECORD_NO NUMBER(10), --
    OWN_CODE VARCHAR2(10),
    PARENT_NO NUMBER(10),
    PARENT_CODE VARCHAR2(10),
    LEVELL NUMBER(4),
    DEPT NUMBER(6),
    CONSTRAINT RNO_PK PRIMARY KEY(RECORD_NO));
    INSERT INTO TREE_01 VALUES(1,'1',0,'0',2,8540);
    INSERT INTO TREE_01 VALUES(2,'2',0,'0',2,8540);
    INSERT INTO TREE_01 VALUES(3,'3',0,'0',2,8540);
    INSERT INTO TREE_01 VALUES(4,'4',0,'0',2,8540);
    INSERT INTO TREE_01 VALUES(5,'1',1,'0',3,8540);
    INSERT INTO TREE_01 VALUES(6,'2',1,'0',3,8540);
    INSERT INTO TREE_01 VALUES(7,'3',1,'0',3,8540);
    INSERT INTO TREE_01 VALUES(8,'1',3,'0',3,8540);
    INSERT INTO TREE_01 VALUES(9,'2',3,'0',3,8540);
    the loop shoud look like
    |_DataProcessing
    | |+Work_orders
    | |_Programmers File
    | | |_James
    | | | |+Requests
    | | | |+Leves
    | | | |_Projects
    | | | |_Projects001
    | | |+Steven
    |+HealthCare
    |+Transportation
    So the loop should be such that it can be go to any level of any node.
    the Code i writter is As follows.
    The Following Procedure is called in form leve
    When new forms instance.
    PROCEDURE REFRESH_TREE2 IS
    CURSOR CUR_DEPT IS
         SELECT DEPT
         FROM TREE_01 GROUP BY DEPT;
    CURSOR CUR_LOOP1(PARENT1 NUMBER,LEVEL1 NUMBER) IS
         SELECT RECORD_NO,
         OWN_CODE,
         PARENT_NO,
         DEPT ,
         PARENT_CODE,
         LEVELL
         FROM TREE_01
         WHERE LEVELL=LEVEL1
         AND RECORD_NO=PARENT1;
    CURSOR CUR_LOOP2(PARENT2 NUMBER,LEVEL2 NUMBER) IS
         SELECT RECORD_NO,
         OWN_CODE,
         PARENT_NO,
         DEPT ,
         PARENT_CODE,
         LEVELL
         FROM TREE_01
         WHERE LEVELL=LEVEL2
         AND RECORD_NO=PARENT2;
    CURSOR LEVEL(PARENTNO NUMBER) IS
         SELECT LEVELL FROM TREE_01 WHERE PARENT_NO=PARENTNO
         ORDER BY RECORD_NO;
         V_I NUMBER;
         V_IGNORE NUMBER;
         RG_DEPT RECORDGROUP;
         RG_CABI RECORDGROUP;
         V_INIT_STATE GROUPCOLUMN;
         V_LEVEL GROUPCOLUMN;
         V_LABEL GROUPCOLUMN;
         V_ICON GROUPCOLUMN;
         V_VALUE GROUPCOLUMN;
         V_CHANGE_VALUE VARCHAR2(20);
         V_CHANGE_VALUE1 NUMBER(3);
         V_CHANGE_VALUE2 NUMBER(3);
    V_LEVEL_COUNT NUMBER;
    BEGIN
         SELECT MAX(LEVELL) INTO V_LEVEL_COUNT FROM TREE_01;
         RG_DEPT:=FIND_GROUP('DEPT');
         if not id_null(RG_DEPT) then
    delete_group(RG_DEPT);
    end if;
         RG_DEPT:=create_group('DEPT');
         V_INIT_STATE := add_group_column(RG_DEPT, 'INIT_STATE', NUMBER_COLUMN);
         V_LEVEL :=ADD_GROUP_COLUMN(RG_DEPT,'LEVEL',NUMBER_COLUMN);
         V_LABEL :=ADD_GROUP_COLUMN(RG_DEPT,'LABEL',CHAR_COLUMN,40);
         V_ICON :=ADD_GROUP_COLUMN(RG_DEPT,'ICON',CHAR_COLUMN,20);
         V_VALUE :=ADD_GROUP_COLUMN(RG_DEPT,'VALUE',CHAR_COLUMN,15);
         V_I :=1;
         FOR DEPTREC IN CUR_DEPT LOOP
         ADD_GROUP_ROW(RG_DEPT,V_I);
         SET_GROUP_NUMBER_CELL(V_INIT_STATE,V_I,1);
         SET_GROUP_NUMBER_CELL(V_LEVEL ,V_I,1);
         SET_GROUP_CHAR_CELL(V_LABEL ,V_I,FILING.ELOOK_IT(11,0,DEPTREC.DEPT));--MAIN_MINOR));
         SET_GROUP_CHAR_CELL(V_ICON ,V_I,NULL);
         SET_GROUP_CHAR_CELL(V_VALUE ,V_I,TO_CHAR(DEPTREC.DEPT)); --MAIN_MINOR));
         V_I:= V_I +1;
         V_CHANGE_VALUE := DEPTREC.DEPT;
         FOR I IN 1..V_LEVEL_COUNT LOOP
         FOR DEPTREC1 IN CUR_LOOP1(V_CHANGE_VALUE,I) LOOP --MAIN_MINOR,I) LOOP
         ADD_GROUP_ROW(RG_DEPT,V_I);
         SET_GROUP_NUMBER_CELL(V_INIT_STATE,V_I,1);
         SET_GROUP_NUMBER_CELL(V_LEVEL ,V_I,I);
         SET_GROUP_CHAR_CELL(V_LABEL ,V_I,DEPTREC1.RECORD_NO);
         SET_GROUP_CHAR_CELL(V_ICON ,V_I,NULL);
         SET_GROUP_CHAR_CELL(V_VALUE ,V_I,DEPTREC1.RECORD_NO);
         V_I:= V_I +1;
         SELECT count(LEVELL) INTO V_CHANGE_VALUE1
    FROM TREE_01
    WHERE RECORD_NO=DEPTREC1.RECORD_NO
         AND PARENT_NO=DEPTREC1.PARENT_NO
         AND LEVELL=DEPTREC1.LEVELL;
         SELECT MAX(LEVELL) INTO V_CHANGE_VALUE2
         FROM TREE_01
         WHERE RECORD_NO=DEPTREC1.RECORD_NO
         AND PARENT_NO=DEPTREC1.PARENT_NO
         AND LEVELL=DEPTREC1.LEVELL;
              FOR j IN 1..V_CHANGE_VALUE1 loop
              FOR LVL IN LEVEL(DEPTREC1.RECORD_NO) LOOP
              FOR DEPTREC2 IN CUR_LOOP2(DEPTREC1.RECORD_NO, LVL.LEVELL) LOOP
         ADD_GROUP_ROW(RG_DEPT,V_I);
         SET_GROUP_NUMBER_CELL(V_INIT_STATE,V_I,1);
         SET_GROUP_NUMBER_CELL(V_LEVEL ,V_I,LVL.LEVELL);
         SET_GROUP_CHAR_CELL(V_LABEL ,V_I,DEPTREC2.RECORD_NO);
         SET_GROUP_CHAR_CELL(V_ICON ,V_I,NULL);
         SET_GROUP_CHAR_CELL(V_VALUE ,V_I,DEPTREC2.RECORD_NO);
         V_I:= V_I +1;
         V_CHANGE_VALUE := DEPTREC2.RECORD_NO;
                   end loop;
         end loop;
         END LOOP;
         END LOOP;
         END LOOP;
         END LOOP;
         ftree.set_tree_property('NAVIGATOR.NAV_DISPLAY',ftree.record_Group, rg_dept);
         end;

  • Question regarding DOM, XML and how to insert child nodes...

    Hi,
    I'm a QA student working on some big project.
    Say you have an XML library holding some symbols by their categories, there are many categories, say we have two 'Miscellaneous' and 'Categories'.
    I want to add to both categories another child:
    the problem is that the way it is done now is:
    symbolCategoryItem.appendChild(newSymbolNode)As you probably know, appendChild(newChild) deletes from the tree the newChild if exists, before inserting it again...
    What should I do to avoid it?

    http://www.cafeconleche.org/books/xmljava/chapters/

  • How to select more than one node in tree

    Hi
    plz any one know how to select multi nodes in tree components ??
    i wana select two employees or more from tree in order to know their informations how can i do that
    10nx for help

    i can select them from different parents that depends on what i want to select Like:
    Admin-Sam
    -Dinda
    Users-David
    -Marylinn
    -Sandra
    for ex: i wana choose Sam , Sandra & David to view thier times and OT on selecting them

Maybe you are looking for

  • Disk Utility Freezes...

    Along with other standard Mac apps, like calculator.... I am getting so annoyed with my Powerbook G4 (running OS X Panther)... I recently had a problem with what I believe started because of a faulty downloaded font which ended up in me having to re-

  • I use Outlook express email this comes up everytime i open an email C:\Users\Marthin Botha\AppData\Local\Temp\WER-56113-0.sysdata.xml in English

    It seems that FireFox is keeping an App file on all the e-mails i receive. the annoying thing is that a window Pops up asking me if i want to open or save the app. On opening it, it logs on to Firefox and display the history of emails received from t

  • Assign variances to another level in Profitability Analysis

    Hi! I need your help. When I post variances in production order, those are sended to PA at level of Material (Article), it´s OK. By the way when I want to view the profitability at customer, hierarchy products or customer groups level I can see reven

  • LDAP Address Book

    I'm setting up OS X mail and it is working perfect. The only problem is I use Apple's Open Directory and I want squirrelmail to look at it over LDAP to pull the address book. I have that working but it only searchs the email name not the givenname or

  • Distribution  and allocation

    Hi Gurus, Please could you help me clarify the difference between distribution like top-down and Allocation as in cost allocation concepts? Thanks Markus Z.