Getting Parent Node On tree Issue..

Hi,
I Have Constructed a Tree and i am Able to get the Details of the clicked Node on the Tree into the Backing Bean.
But I'm unable to get the Parent Node of the Clicked Child Node.
Ex:On Click of Employee(Child Node) in the Tree, I should get the Department (Parent Node) in Backing Bean.
I'm able to get only the details in the same Level of Tree Node(ie All Employees in the Selected Employee Level).
IDE: JDeveloper 10.1.3.2.
Please Suggest me.
Thanking You,
Bandaru.

Sounds like you are looking for something like this
Connected to Oracle Database 11g Enterprise Edition Release 11.1.0.6.0
SQL> WITH table_1 AS
  2  (SELECT XMLTYPE('<sdi_header>
  3  <Person>
  4  <Customer_First_Name>ABC</Customer_First_Name>
  5  <Customer_Last_Name>DEF</Customer_Last_Name>
  6  </Person>
  7  <warehouse>
  8  <Person>
  9  <Customer_First_Name>XYZ</Customer_First_Name>
10  <Customer_Last_Name>MNO</Customer_Last_Name>
11  </Person>
12  </warehouse>
13  </sdi_header>') column_name
14     FROM dual)  -- WITH simulates your table I do not have
15  select t1.*
16    from TABLE_1,
17         XMLTABLE('for $i in /sdi_header//Person
18                     return <root>
19                           {$i/Customer_First_Name,
20                           $i/Customer_Last_Name}
21                           <parent>{$i/../name()}</parent>
22                      </root>'
23                  PASSING table_1.column_name
24                  COLUMNS
25                  fname   VARCHAR2(20) PATH 'Customer_First_Name',
26                  lname   VARCHAR2(20) PATH 'Customer_Last_Name',
27                  pnode   VARCHAR2(20) PATH 'parent') t1;
FNAME                LNAME                PNODE
ABC                  DEF                  sdi_header
XYZ                  MNO                  warehouseYou can find out how formatted that message by looking in the FAQ in the upper right. It uses the { code } tag (without spaces).

Similar Messages

  • 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?

  • Insert Parent Node From Tree To Another

    Hello
    My problem is: haw can I insert or shift Parent Node with its child from tree to another without use SQL query.
    I should find the child and if this child has a child to shift with the parent to another tree, there are no tools or function can return the child of the node? Or what is the best procedure to do that?
    I will be thankful if there some one can help me
    Regards

    You can grab the data with ftree.populate_group_from_tree and then use ftree.add_tree_data to put it in another tree.

  • How to get Parent nodes and corresponding child nodes in BI Hierarchy

    Hi all,
    I have a standard function module 'RSNDI_SHIE_STRUCTURE_GET3'  to get child node if i pass parent node. But I need child nodes along with the provided parent node as I use this in a loop in BI.
    Thanks

    Could any one help me in this regards .
    Thanks in advance
    Regards,
    sri

  • Get Parent node from Base member

    Hi ,
    My user select base member from CV .
    I want parent node for that base member .
    I am using =EVPRO( App name , memmber id , "PARENTH1" ) .
    I am not getting parent member from this funcation .
    Pls let me know any other way for this ?
    regards,
    PSR

    Hi,
    EVPRO for getting the value for PARENTH1 of any member should work. Please check whether you have included all the parameters of this function inside double quotes.
    EVPRO("APPNAME","MEMBER_ID","PROPERTY")
    Hope this helps,
    Regards,
    G.Vijaya Kumar

  • Getting Parent Node using SQL

    Hello,
    I am trying to query an XML which is stored in XMLTYPE datatype column in oracle table. I am using the below SQL:
    select
    EXTRACTVALUE (column_name, '/Person/Customer/Customer_First_Name'),
    EXTRACTVALUE (column_name, '/Person/Customer/Customer_Last_Name'),
    from TABLE_1 A, TABLE ( XMLSEQUENCE (EXTRACT (A.column_name, '/sdi_header//Person')) ) P
    Sample XML:
    <sdi_header>
    <Person>
    <Customer_First_Name>ABC</Customer_First_Name>
    <Customer_Last_Name>DEF</Customer_First_Name>
    </Person>
    <warehouse>
    <Person>
    <Customer_First_Name>XYZ</Customer_First_Name>
    <Customer_Last_Name>MNO</Customer_First_Name>
    </Person>
    </warehouse>
    </sdi_header>
    In the above query the Alias P has a //Person which means I am trying to extract all the repeating person Nodes information in XML. Retrieving all persons is working but I want to extract the parent node information of each Person like for Example in the above sample XML, it has two persons in it
    1) 1 Person is coming under sdi_header node , in such case I need to get <sdi_header/> in SELECT statement
    2) 1 Person is coming under warehouse node , in such case I need to get <warehouse/>in SELECT statement
    How can the parent node information be extracted in SELECT statement.
    Any suggestion/Help is much appreciated.
    Thanks,
    SKM
    Edited by: user9116854 on Mar 1, 2010 10:24 AM
    Edited by: user9116854 on Mar 1, 2010 10:30 AM
    Edited by: user9116854 on Mar 1, 2010 10:35 AM
    Edited by: user9116854 on Mar 1, 2010 10:45 AM
    Edited by: user9116854 on Mar 2, 2010 8:05 AM

    Sounds like you are looking for something like this
    Connected to Oracle Database 11g Enterprise Edition Release 11.1.0.6.0
    SQL> WITH table_1 AS
      2  (SELECT XMLTYPE('<sdi_header>
      3  <Person>
      4  <Customer_First_Name>ABC</Customer_First_Name>
      5  <Customer_Last_Name>DEF</Customer_Last_Name>
      6  </Person>
      7  <warehouse>
      8  <Person>
      9  <Customer_First_Name>XYZ</Customer_First_Name>
    10  <Customer_Last_Name>MNO</Customer_Last_Name>
    11  </Person>
    12  </warehouse>
    13  </sdi_header>') column_name
    14     FROM dual)  -- WITH simulates your table I do not have
    15  select t1.*
    16    from TABLE_1,
    17         XMLTABLE('for $i in /sdi_header//Person
    18                     return <root>
    19                           {$i/Customer_First_Name,
    20                           $i/Customer_Last_Name}
    21                           <parent>{$i/../name()}</parent>
    22                      </root>'
    23                  PASSING table_1.column_name
    24                  COLUMNS
    25                  fname   VARCHAR2(20) PATH 'Customer_First_Name',
    26                  lname   VARCHAR2(20) PATH 'Customer_Last_Name',
    27                  pnode   VARCHAR2(20) PATH 'parent') t1;
    FNAME                LNAME                PNODE
    ABC                  DEF                  sdi_header
    XYZ                  MNO                  warehouseYou can find out how formatted that message by looking in the FAQ in the upper right. It uses the { code } tag (without spaces).

  • HOw to get parent node name value through its child node?

    Hi,
    Experts,
    I am able to get child node name values but according to attribute name value i want to  get its parent name value how to achieve that. For that i have used If_Ixml_element->Get_parent. Please pass some idea on it.
    Thanks in advance,
    Shabeer ahmed.

    Hello Shabeer
    I think the coding should be straightforward:
    DATA: lo_element   TYPE REF TO if_ixml_element,
              lo_child        TYPE REF TO if_ixml_node,
              lo_parent      TYPE REF TO if_ixml_node.
    " NOTE: LO_ELEMENT holds your child node
      lo_child ?= lo_element.
      lo_parent = lo_child->get_parent( ).
    Regards
      Uwe

  • Hierarchy  Query  to  get  parent  nodes?

    Hi Everyone,
    I want to write a hierarchy query which should give me the path starting from given node to its parents(Grand parents). below is the sample data and the output what i am expecting. and also the output what i am getting right now from my query.
    CREATE TABLE RELATION (PARENT VARCHAR2(5),CHILD VARCHAR2(5) PRIMARY KEY);
    --Data for the tree which starts from the root 'A'
    Insert into RELATION (PARENT, CHILD) Values (NULL,'A');
    Insert into RELATION (PARENT, CHILD) Values ('A', 'B');
    Insert into RELATION (PARENT, CHILD) Values ('A', 'C');
    Insert into RELATION (PARENT, CHILD) Values ('B', 'D');
    Insert into RELATION (PARENT, CHILD) Values ('B', 'E');
    Insert into RELATION (PARENT, CHILD) Values ('D', 'F');
    Insert into RELATION (PARENT, CHILD) Values ('C', 'G');
    --Data for the tree which starts from the root 'H'
    Insert into RELATION (PARENT, CHILD) Values (NULL,'H');
    Insert into RELATION (PARENT, CHILD) Values ('H', 'I');
    Insert into RELATION (PARENT, CHILD) Values ('H', 'J');
    Expected Output by passing values as 'F' which gives the path from bottom to up.
    A<-B<-D<-F
    My Query:
    SELECT substr(sys_connect_by_path(child,'<-'),3)
    FROM relation
    WHERE connect_by_isleaf = 1
    START WITH child = 'F'
    CONNECT BY PRIOR parent = child
    ORDER BY child;
    Output of my query:
    F<-D<-B<-A
    I am getting the output in reverse order. i can use the reverse string function to reverse the string but the problem is the node can also contain the values like 'AC' 'BA'.. in future.
    Can anyone please help me in getting the correct output.
    Thank you in advance.

    I like ListAgg :D
    with RELATION(PARENT,CHILD) as(
    select NULL,'A' from dual union all
    select 'A', 'B' from dual union all
    select 'A', 'C' from dual union all
    select 'B', 'D' from dual union all
    select 'B', 'E' from dual union all
    select 'D', 'F' from dual union all
    select 'C', 'G' from dual union all
    select NULL,'H' from dual union all
    select 'H', 'I' from dual union all
    select 'H', 'J' from dual)
    SELECT ListAgg(child,'<-')
           within group(order by Level desc) as revPath
    FROM relation
    START WITH child = 'F'
    CONNECT BY PRIOR parent = child;
    revPath
    A<-B<-D<-F

  • 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

  • Using xpath to get parent nodes

    hi! i�m trying to copy some elements from a xml file, and i have some problems.
    i have this file
    ?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="xslpath.xsl"?>
    <bookstore>
    <book id="0">
    <title id="pt">Harry Magico</title>
    <desc id="1">
    <price id="3">29.99</price>
    <price1 id="3">329.95</price1>
    </desc>
    <name>nome</name>
    </book>
    </bookstore>
    i�m using a xsl to copy the nodes.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:template match="/">
    <xsl:copy-of select="/bookstore/book/title/ancestor-or-self::price1"/> <!--not correct-->
    </xsl:template>
    </xsl:stylesheet>
    well, if i select price1 node, what i want to get is:
    <?xml version="1.0" encoding="utf-8"?>
    <bookstore>
    <book id="0">
    <desc id="1">
    <price1 id="3">329.95</price1>
    </desc>
    </book>
    </bookstore>
    i just want copy the node without is "brothers" :) and with is parents.
    can anyone help me?

    hi! i�m trying to copy some elements from a xml file,
    and i have some problems.
    i have this file
    ?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl"
    href="xslpath.xsl"?>
    <bookstore>
    <book id="0">
    <title id="pt">Harry Magico</title>
    <desc id="1">
    <price id="3">29.99</price>
    <price1 id="3">329.95</price1>
    </desc>
    <name>nome</name>
    </book>
    </bookstore>
    i�m using a xsl to copy the nodes.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">
    <xsl:template match="/">
    <xsl:copy-of
    select="/bookstore/book/title/ancestor-or-self::price
    "/> <!--not correct-->
    </xsl:template>
    l:stylesheet>
    well, if i select price1 node, what i want to get
    is:
    <?xml version="1.0" encoding="utf-8"?>
    <bookstore>
    <book id="0">
    <desc id="1">
    <price1 id="3">329.95</price1>
    </desc>
    </book>
    </bookstore>
    i just want copy the node without is "brothers" :)
    and with is parents.
    can anyone help me?right off my head, try this:
    /bookstore/book/title/desc/price1/ancestor-or-self::*

  • SRM Get parent node

    Dear experts,
    I need to know a FM or BAPI in order to know the parent objetc/record/document that contains an element.
    SAP provides the BAPI BAPI_RECORD_GETELEMENTS to get the elements of a record, but I need the opposite operation (get the record that contains the element).
    Thanks in advance.
    Best regards,
    A. Cepa

    Hi,
    EVPRO for getting the value for PARENTH1 of any member should work. Please check whether you have included all the parameters of this function inside double quotes.
    EVPRO("APPNAME","MEMBER_ID","PROPERTY")
    Hope this helps,
    Regards,
    G.Vijaya Kumar

  • Re: Hierarchy  Query  to  get  parent  nodes?

    Guys i need a help here please....
    i want to query using any single value for example in where clause for  "E" , i want to retrieve whole bunch from "A" to "G" which are all interlinked. is there any way for  this?..
    im lookking like
    A
    B
    C
    D
    E
    F
    G
    when i query for "E"
    Thanks in advance..

    sorry,,, i couldn't explain properly...
    here is the example...
    CREATE TABLE RELATION (PARENT VARCHAR2(5),CHILD VARCHAR2(5) PRIMARY KEY);
    ---this is group 1
    Insert into RELATION (PARENT, CHILD) Values ('A', 'B');
    Insert into RELATION (PARENT, CHILD) Values ('A', 'C');
    Insert into RELATION (PARENT, CHILD) Values ('B', 'D');
    Insert into RELATION (PARENT, CHILD) Values ('B', 'E');
    Insert into RELATION (PARENT, CHILD) Values ('D', 'F');
    Insert into RELATION (PARENT, CHILD) Values ('C', 'G');
    --This is group 2
    Insert into RELATION (PARENT, CHILD) Values ('H', 'I');
    Insert into RELATION (PARENT, CHILD) Values ('H', 'J');
    Insert into RELATION (PARENT, CHILD) Values ('J', 'K');
    Insert into RELATION (PARENT, CHILD) Values ('K', 'M');
    I WILL TAKE  group 1 ..
    i want from relation table single  column all related falling in one group . like..
    when i look for E i should get all the below..
    A
    B
    C
    D
    E
    F
    G
    even though E is not directly linked to A it is linked through B. basically all in one group but the link is not direct. i dont have any group key in my table..
    the query column (where clause) can be either parent or child..
    hope u will gettit..   thanks for ur patience...

  • Problem with Jtree to xml tranform..how to set/get parent of a node?

    Hi,
    I am trying to develop xml import/export module.In import wizard, I am parsing the xml file and the display it in Jtree view using xml tree model which implements TreeModel and xml tree node.I am using jaxp api..
    It is workin fine.
    I got stuck with removal of selected node and save it as a new xml.
    I am not able to get parent node of selected node in remove process,itz throwing null.I think i missed to define parent when i load treemodel.Plz help me out..give some ideas to do it..
    thanks
    -bala
    Edited by: r_bala on May 9, 2008 4:44 AM

    there's no way anyone can help you without seeing your code.

  • ADF Tree setting focus back to parent node after deletion of child node

    Hi,
    Is there a way to get the focus back to the parent node (or rather any particular node) in a tree?
    I have a use case where we need to get the focus back to the parent node after a child node is deleted.
    Currently the focus is shifted to the next node in the tree, but the need is to get the focus shifted back to the parent node. Also the parent node should be re-invoked to populate to get the latest status after deletion of the child node.
    Any help/pointers?
    Thanks

    Thanks for the reply Frank.
    I saw the link http://sreevardhanadf.blogspot.in/2012/07/showing-next-row-as-current-row-after.html
    However the issue is since I am using custom created tree using POJO tree item (composite object).
    calling myTree.getWrappedData() doesn't gives me a handle to JUCtrlHierBinding and subsequent access to JUCtrlHierNodeBinding.
    my program gives me data like -
    List<MyTreeItem> treeData = (List<MyTreeItem>)treeModel.getWrappedData();
    because my tree model is build using -
    treeModel = new ChildPropertyTreeModel(items, "children");
    where items is List of <MyTreeItem>
    Hence I am unable to get a handle using -
    List nodeParentList = nodeParent .getKeyPath();
    I am programmatically able to invoke the parent node to get the fresh data, only issue is the focus/selection of that node is not happening
    Is there a way around?
    Thanks
    Sachin

  • Displaying leaf nodes at the bottom of a tree that has parent nodes

    I have a problem in that - leaf nodes added to the tree at the bottom appear with big spaces (vertically) between them. It looks as if the nodes are somehow expanded by default!
    Is this a known issue with leaf nodes that are added in below parent nodes?
    I notice in the normal hierarchy the leaf nodes are displayed fine. Also if I return false on isleaf() it displays the last 3 nodes as expandable icons but they're still lage gaps between them.
    this is an example of what i'm getting
    Main �
    +Parent Node(expandable)
    |
    +Parent Node(expandable)
    |
    +Parent Node(expandable)
    |
    |
    |_leaf node (not expandable)
    |
    |
    |_leaf node (not expandable)
    |
    |
    |_leaf node (not expandable)

    You got my interest with your topic subject as I'm working on a library which simplifies the development with Swing trees. However everyone here except you knows nothing about your "anormal hierarchy" which creates you problem.
    Denis Krukovsky
    http://sourceforge.net/projects/dotuseful/

Maybe you are looking for

  • How do I add gmail to the links on the left hand side of my browser

    I don't know what else to add it reads across the top web videos maps news shopping books more how can I add gmail to that list? I never use shopping I never use books

  • Bridge will not open

    I just re-installed CC apps on a new hard drive.  All seem to be starting fine except for Bridge.  When I start Bridge I get an error that says "The Operation Could Not Be Competed"  I am paying 50 freaking dollars a month for this stuff.  I expect i

  • Watchmen digital copy code not working

    I just bought a "watchmen director's cut" combo Blu-Ray and digital copy.  It was new in the shrink wrap from Target.  I'm trying to get the digital copy into my itunes, which is current release.  I've done this before for other movies without a prob

  • Looking for experienced insight...

    My iPod has been working fine for months now...then 2 days ago I notice that there is a new upgrade for the iTunes store...I downloaded the 7.2 iTunes store upgrade...Now I can't get anything but this message "iTunes has encountered a problem and nee

  • Function module to display process overview log from SM66 Transaction

    Hi, I want to display process overview log from SM66 Transaction in a report. Is there a function module which will help me in achieving that or is there any other method. Thanks in advance, Sandeep.