Self referencing VO in an ADF Tree

Hi @all
i want to create an ADF Tree and found the following helpful example:
ADF Code Corner sample #32 show how to build a tree table from a self referencing VO:
[http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html#CodeCornerSamples]
But i still have two questions:
1. How can i concatenate two attributes in the View Instance?
Table looks like
ID ParentID OrderNo ShortText
====================
1 (null) 10 Text1
2 1 20 Text2
3 2 30 Text3
4 1 50 Text4
The result should be 10.20.30.
2. For the first tree-level the change of the ShortText attribut works fine:
OrderNo: 10 -> Text1
OrderNo: 50 -> Text4
(Tree->SelectionListener: #{bindings.WicNodeView1.treeModel.makeCurrent}
RichTextEditor -> partialTrigger: t1 (the Tree))
But not for the Sub-Levels:
The Problem is OrderNo 30 shows also Text1 (and not Text3).
Do i have to write a method (bean) for the Selection Listener or is there another (shorter) way (i am using Oracle JDeveloper 11.1.2.1.0)?
Thanks for your help!
Gregor

Hi,
this should work the same. You create a tree from a POJO Data Control based on your POJO Model. Expose another collection pointing to the same data set and drag it as the form. Use the setting on the tree configuration dialog to set the current row in the tree as the current in the form iterator.
Frank

Similar Messages

  • Self referencing tree flavoured with another table

    hello community,
    sorry for stupid thread title, but I can't find the right description for what I want to do atm :)
    I'm trying to create a tree from a self referencing table, but in addition I have to display childs with data from an aditional table (with reference to self referencing table). I'm using the latest JDeveloper (11.1.1.2.0) with internal WebLogic.
    To create a "not so fictive" scenario: HR.EMPLOYEES + (new) table PROJECTS (project_id, employee_id, project_name) - I want to create a tree of all employees starting with King and in addition display the assigned projects for each employee.
    It works fine without the PROJECTS table - self referencing just works as intended:
    I did this by creating a "root" viewobject on EmployeesEO ("where EmployeesEO.MANAGER_ID is null"), one "standard" viewobject on EmployeesEO (EmployeesEOView) and one viewlink on EmployeesEOView linking to itself (0..1:* EmployeeId - ManagerId):
    some screenshots:
    [the datamodel|http://img405.imageshack.us/img405/9931/selfrefworksdatamodel.png]
    [the binding rules|http://img525.imageshack.us/img525/6606/selfrefworksbinding.png]
    [the browser output|http://img6.imageshack.us/img6/2906/selfrefworksbrowser.png]
    Next, I created another (standard) viewobject on my (new) table "projects" and then created a new viewlink on EmployeesEOView (source) linking to my new AspProjectsEOView (destination) with cardinality 0..1:* EmployeeId - EmployeeId.
    After this, I added the new created viewlink to the data model of the application module and bound the new data control to the page again (as best as I could figure out the bindings).
    The result is kinda strange, I guess because ADF wants (but can't) figure out wich one to display. Well it should not display one of them, but both.
    again, some screenshots:
    [the datamodel|http://img297.imageshack.us/img297/6721/selfrefnotokdatamodel.png]
    [the binding rules|http://img263.imageshack.us/img263/6820/selfrefnotokbinding.png]
    [the browser output|http://img263.imageshack.us/img263/1720/selfrefnotokbrowser.png]
    Well you may ask yourself what's my desired result: All stays the same (in this example) but the last "manager" looks like this (in expanded mode)
    201 Michael Hartstein 100
    ____> 202 Pat Fray 201
    ____> Project 1
    Any employee without projects should appear in the usual way (not to be filtered out), the projects should just be added.
    My question is: is this even possible? If yes, how? If not, is there a way to "adjust" the output text of the "subviews" (this could be a "low tech" version - subelements named "Employees" and "Projects" instead of "EmployeesEOView" and "AspProjectsEOView")
    Thanks alot in advance for any hint!
    Edited by: asp_jko on 18.12.2009 17:46

    any help? please! :)

  • Synchronize form with self-referencing VO in tree table. POJO Based Model

    Hello. I need your help
    ADF Code Corner sample #32 show how to build a tree table from a self referencing VO:
    [http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html#CodeCornerSamples]
    ADF Code Corner document Oracle JDeveloper OTN Harvest 09/2011 by Frank Nimphius show how to build an edit form for the table data and how to synchronize it with the selected row in the tree table:
    [http://www.oracle.com/technetwork/developer-tools/adf/learnmore/sept2011-otn-harvest-508189.pdf]
    This examples are helpful, but i have a problem, i have not a model based on a database, my application datamodel is based in POJO objects, there are no appModules or ViewObjects so I do not know how to reference the tree table target attribute with the edit form iterator.
    Can anyone help me?
    Maybe (i dont know how) i need make a VO and a AppModule that wraps the POJO model ?
    thank you very much

    Hi,
    this should work the same. You create a tree from a POJO Data Control based on your POJO Model. Expose another collection pointing to the same data set and drag it as the form. Use the setting on the tree configuration dialog to set the current row in the tree as the current in the form iterator.
    Frank

  • How to build query to get tree architecture of self referencing table

    Dear all,
    I have the following table design :
    This is a self referencing table representing a set of SubCategories which can have parent sub categories or not. I did not show here the Category table.
    If the Subcategory has the ParentSubCategory ID = null, then this is a root subcategory otherwise it is a child of a parent sub category.
    What I am looking for is the easy way to display the structure level by ProductCategoryID ?
    Thanks for helps

    you can use a recursive logic based on CTE for that
    something like this would be enough
    ;WITH ProdSubCat_Hiererchy
    AS
    SELECT psc.ProductSubCategoryID,c.CategoryName,psc.ParentSubCategoryID, psc.Name,CAST(psc.Name AS varchar(max)) AS [Path],1 AS [level]
    FROM ProductSubCategory psc
    INNER JOIN Category c
    ON c.CategoryID = psc.ProductCategoryID
    WHERE psc.ParentSubCategoryID IS NULL
    UNION ALL
    SELECT psc.ProductSubCategoryID,c.CategoryName,psc.ParentSubCategoryID, psc.Name,CAST(psch.[Path] + '/' + psc.Name AS varchar(max)) AS [Path],psch.[level] + 1
    FROM ProductSubCategory psc
    INNER JOIN Category c
    ON c.CategoryID = psc.ProductCategoryID
    INNER JOIN ProdSubCat_Hiererchy psch
    ON psch.ProductSubCategoryID = psc.ParentSubCategoryID
    SELECT *
    FROM ProdSubCat_Hiererchy
    ORDER BY LEFT([Path],CHARINDEX('/',[Path]+'/')-1),[Level]
    OPTION (MAXRECURSION 0)
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Self Referencing Tables...

    I have a self-referencing table (a Topic can be a response to another Topic) and read one of Frank Nimphius' blogs on this subject, posted on the ADF board for advise. As a result I created the read-only ViewObject to set up this tree relationship and set it to be exposed to the App Module.
    Do I need to do more to it than that for JHeadstart to generate the right page defs? Any advise on setting this up cleanly? My user interface must present a page in which users can post new Topics, view topics in a heirarchy (response thread, like in this forum) and respond to Topics or responses. A response is a Topic that references another (parent) Topic. I have to believe this has been done before a million times but am not sure myself how to do it.
    Thanks!

    Steve,
    I've read the section and am getting this error:
    (oracle.jbo.SQLStmtException) JBO-27122: SQL error during statement preparation. Statement: SELECT Topic.SUBJECT, Topic.ROW_ID, Status.STATUS_CHOICE, Status.ROW_ID AS ROW_ID11, Topic.CREATED_BY, Topic.CREATION_DATE, Response.SUBJECT AS SUBJECT1, Response.CREATION_DATE AS CREATION_DATE1, Response.ROW_ID AS ROW_ID12, Response.CREATED_BY AS CREATED_BY1 FROM TOPIC Topic, RESPONSE Response, STATUS Status WHERE (Topic.ROW_ID = Response.MASTER_ID (+)) AND (Topic.TOPIC_STATUS_ID = Status.ROW_ID) CONNECT BY PRIOR Topic.ROW_ID = Response.MASTER_ID (+) OR Response.ROW_ID = Response.MASTER_ID (+) ORDER BY SUBJECT,CREATION_DATE1
    ----- LEVEL 1: DETAIL 0 -----
    (java.sql.SQLException) ORA-01436: CONNECT BY loop in user data
    I have a table called Topic with a Pk called ROW_ID and another table called Response with a Pk called ROW_ID and an Fk called MASTER_ID. A Topic can have many Responses and a Response can also have many Responses. The parent ID could point to either a Topic or a Response. There's no limit on how many levels this can continue. There's a Status table also from which I want to show the text value of the Status for the Topic row (not the Status ROW_ID)
    I have a View Object including entities: Topic, Response & Status
    I tried the SQL query as:
    (Topic.ROW_ID = Response.MASTER_ID (+)) AND (Topic.TOPIC_STATUS_ID = Status.ROW_ID) CONNECT BY PRIOR Topic.ROW_ID = Response.MASTER_ID (+) OR Response.ROW_ID = Response.MASTER_ID (+)
    Hoping to have this result:
    Topic A
    -Response A (to Topic A)
    --Response B (to A)
    ---Response C (to B)
    -Response D (to Topic A)
    Topic B
    Topic C
    What am I doing wrong?
    Is there a guide that explains better using JHeadstart with JDeveloper (rather than Oracle Designer, which we don't use)? The developer's guide for JHeadstart is hard to translate for use with JDeveloper...
    Thanks!!

  • Check/Uncheck issue in ADF Tree

    Hi,
    I am using JDev 11.1.1.5.0. Iam trying to create a ADF Tree from Single VO object with self-reference with check box option. Iam able to create required ADF tree with checkbox option. Some how, unable to provide select-deselect functionality. I mean, if we select any node from the tree, all the sub nodes (till leaf node) should be in select state. Only one node in select state. Rest are not updating.
    Tried to find in JDev forum. Could not able to find suitable topic.
    Tried to implement the process given in the below URL..But no use !!!
    http://andrejusb.blogspot.in/2011/12/adf-tree-how-to-autoselectdeselect.html
    Created two transient attributes at VO level
    checkboxConfirmed - Boolean..It's value will dependent on checkboxConfirmedStatus attribute, which is of type String.
    Finally I am trying to provide technical details what I did so far. It might be lengthy :)
    Following is the JSPX page code
    ===============================
    <f:view>
    <af:document id="d1">
    <af:messages id="m1"/>
    <af:form id="f1">
    <af:tree value="#{bindings.HierLinks1.treeModel}" var="node"
    id="t1"
    binding="#{pageFlowScope.mBean.treeProp}">
    <f:facet name="nodeStamp">
    <af:group id="g1">
    <af:selectBooleanCheckbox
    label="Label 1"
    id="sbc1"
    value="#{node.checkboxConfirmed}"
    autoSubmit="true"
    valueChangeListener="#{pageFlowScope.mBean.checkBoxChange}"
    />
    <af:outputText value="#{node.ChildItemId}" id="ot1"/>
    </af:group>
    </f:facet>
    </af:tree>
    </af:form>
    </af:document>
    </f:view>
    mBean code goes as follows:
    public void checkBoxChange(ValueChangeEvent valueChangeEvent) {
    System.out.println("Start checkBoxChange ");
    System.out.println("OLD VALUE:"+valueChangeEvent.getOldValue());
    System.out.println("NEW VALUE:"+valueChangeEvent.getNewValue());
    DCIteratorBinding dcIb = ADFUtils.findIterator("HierLinks1Iterator");
    HierLinksVORowImpl parent = (HierLinksVORowImpl)dcIb.getCurrentRow();
    RowIterator ri = parent.getLeafHierLinks();
    // parent.setAttribute("checkboxConfirmedStatus", "Y");
    //RowSetIterator ri = parent.getRowSet();
    Boolean check = (Boolean)valueChangeEvent.getNewValue();
    while(ri.hasNext()){
    LeafHierLinksVORowImpl leaf = (LeafHierLinksVORowImpl)ri.next();
    System.out.println("Leaf ChildItemId"+leaf.getAttribute("ChildItemId"));
    if (check == true) {
    parent.setAttribute("checkboxConfirmedStatus", "Y");
    leaf.setAttribute("checkboxConfirmedStatus", "Y");
    else{
    parent.setAttribute("checkboxConfirmedStatus", "Y");
    leaf.setAttribute("checkboxConfirmedStatus", "N");
    System.out.println("Leaf checkboxFlag 222"+leaf.getAttribute("checkboxConfirmed"));
         Tried to iterate the tree in another approach.
    if( (Boolean)(valueChangeEvent.getOldValue()) != null) {
    Boolean check = (Boolean) valueChangeEvent.getNewValue();
    RichTree navTree = this.getTreeProp();
    CollectionModel model = (CollectionModel)navTree.getValue();
    JUCtrlHierBinding treeBinding = (JUCtrlHierBinding)model.getWrappedData();
    JUCtrlHierNodeBinding currentSelectedNode = (JUCtrlHierNodeBinding)navTree.getRowData();
    List<JUCtrlHierNodeBinding> children = currentSelectedNode.getChildren();
    if (children != null) {
    for (JUCtrlHierNodeBinding _node : children) {
    //Each child search returns node check status
    Row nodeRow = _node.getRow();
    if (nodeRow != null) {
    //_node.setAttribute("checkboxConfirmedStatus",true);
    String childId = (String)_node.getAttribute("ChildItemId");
    System.out.println("CHILDID"+childId);
    String[] atts = (String[]) _node.getAttributeNames();
    System.out.println(Arrays.asList(atts));
    System.out.println("CHECK"+check );
    if(check == true){
    _node.setAttribute("checkboxConfirmedStatus","Y");
    else{
    _node.setAttribute("checkboxConfirmedStatus","N");
    System.out.println("Check Status"+_node.getAttribute("checkboxConfirmed") );
    }else{
    System.out.println("NODE ROW NULL");
    } //End of for loop
    else{
    System.out.println("children NULL");
    else{
    System.out.println("OLD VALUE NULL");
    //refreshSelectedRows();
    System.out.println("End checkBoxChange ");
    Iam suspecting, in JSPX page value="#{node.checkboxConfirmed}" is updating the checkbox status.
    Could please help me on this?
    Thanks in advance,
    Samba.

    Finally able to achieve by enabling 'Retain View Link Accessor Rowset'.
    Thanks,
    Samba

  • Duplicate nodes in ADF Tree

    Duplicate Entries in ADF Tree
    Hi,
    Iam facing issue with ADF Tree representation. Getting content from DB. I've a table with self reference. Iam able to provide check box for each node. Following is the usecase of issue
    a->b->c->1.xml
    a->b1->c1->2.xml
    a->b2->c2->3.xml
    Issue 1: It's dispaling 3 a's at the first level. But it should display a once within that b,b1,b2 as sub levels.
    Even though it's showing 'a' three times, if we click on second & third 'a', first 'a' is effecting. Please suggest to filter duplicate entries while displaing. Following is code snippet of jspx.
    <af:tree value="#{bindings.ParentMDTopic1.treeModel}" var="node"
    selectionListener="#{bindings.ParentMDTopic1.treeModel.makeCurrent}"
    rowSelection="multiple" id="t1"
    partialTriggers="#{pageFlowScope.mBean.checkboxFlag.addValueChangeListener}">
    <f:facet name="nodeStamp">
    <af:group id="g1">
    <!-- <af:selectBooleanCheckbox
    label="Label 1" id="sbc2"
    valueChangeListener="#{pageFlowScope.mBean.checkBoxChange}"/> -->
    <af:selectBooleanCheckbox label="Label 1" id="sbc2"
    value="#{node.checkboxFlag}"
    autoSubmit="true"
    valueChangeListener="#{pageFlowScope.mBean.checkBoxChange}"/>
    <af:outputText value="#{node}" id="ot1"/>
    </af:group>
    </f:facet>
    </af:tree>
    Issue 2: Select/Deselect functionality. If we click on any node, the child nodes & sub levels till leaf nodes should be in select state. Similarly for deselect functionality.
    In order to acheve functionality, Created two transient attributes of boolean & string type. I tired to debug the ManagedBean, seems to be it's traversing to sublevels & changing the transient attribute. But while display it's not effeting. Please suggest a hint on this. It could be great if you provide some useful pointers to refer.
    Thanks in advance,
    Samba.

    Hi,
    I've provided Parent-Child relationship(Self-reference).
    Following is the table structure with primary/foreign key constraints.
    DELIVERY_VERSION_ID (PK)(FK)
    HIERARCHY_ID (PK)(FK)
    DOC_GUID (PK)
    PARENT (FK)
    CURRENTTITLE
    LANGUAGE
    Please let me know, if you have any comments on table structure.
    Following is the sample data in table
    DELIVERY_VERSION_ID     DOC_GUID Parent HIERARCHY_ID
    3               a     null     a_b_c
    3               b     a     a_b_c
    3               c     b     a_b_c
    3               1.xml     c     a_b_c
    3               a     null     a_b1_c1
    3               b1     a     a_b1_c1
    3               c1     b1     a_b1_c1
    3               2.xml     c1     a_b1_c1
    3               a     null     a_b2_c2
    3               b2     a     a_b2_c2
    3               c2     b2     a_b2_c2
    3               3.xml     c2     a_b2_c2
    Thanks,
    Samba.

  • Self referencing table and SQL statement

    In my database, I have a self-referencing table, the table itself is for projects, and it allows users to get a hierarchical view of the company.
    Here is the SQL (modifier is the term we use for project code, BBCI is the top project)
    SELECT
    modifier, modifierDescription, level
    FROM
    modifier
    WHERE
    level <= 2
    CONNECT BY PRIOR
    modifier = parentModifier
    START WITH modifier = 'BBCI'
    ORDER BY level
    That perticular query gets the first two levels in the structure. I use this information to produce a tree structure in a web app.
    But users have requested it would be good if in the tree structure is showed an + or - depending on whether there were anymore children under each parent, or better still the number of children under it, for example
    BBCI
    + BBCI_CHILD
    + BBCI_CHILD2
    - BBCI_CHILD3
    or
    BBCI
    + BBCI_CHILD (3 projects underneath)
    + BBCI_CHILD2 (2 projects underneath)
    - BBCI_CHILD3 (0 projects underneath)
    I am really stumped on this issue, and I am sure there is a way to do this in the web app, so for example do a query for each child node to see how many child nodes are underneath, but I figure it would be a lot tidier and faster if I could do it from a single SQL statement. Unfortunately I have tried to do this and am very much stuck.
    If you need more information please let me know
    Thanks!
    Jon

    You may be able to do this using analytical functions but it depends on the Oracle version you are using. It can also be done with standard SQL - you just need to count the number of child rows for each modifier/project first and supply that list as an in-line view:
    SELECT decode(modifier,'X',null,decode(child_rows,null,'-','+')),
    m.modifier,
    decode(modifier,'X',null,'('||nvl(cq.child_rows,0)||' projects underneath)')
    FROM modifier m,
    (select parentModifier,
         count(parentModifier) child_rows
    from modifier
    where parentModifier is not null
    group by parentModifier) cq
    WHERE m.modifier=cq.parentModifier(+)
    AND level <= 2
    CONNECT BY PRIOR
         m.modifier = m.parentModifier
    START WITH modifier = 'X'
    ORDER BY level, modifier;
    which gives you something like...
    D MODIFIER DECODE(MODIFIER,'X',NULL
    X
    - Y1 (0 projects underneath)
    + Y2 (2 projects underneath)
    + Y3 (3 projects underneath)
    The decode stuff is just to show you the result, you can format the output in your calling code. Just extend the columns to include everything you want, modifierDescription etc..
    Hope this helps.

  • Self referencing table and contraint

    Hi,
    I have a self referencing table, used to store information on projects in an organization. There is a pimary key (modifier) and a foreign key to the modifier field (parentModifier)
    Note: (modifier = project in the organization)
    Basically, the parentModifier cannot be equal to the modifier in the same table, or equal to any of its children, otehrwise you get wierd recursive relationships. Its like saying you cannot be your own father, or one of your children cannot be your father. To get a list of the modifiers the parentModifier cannot be, the following statement can be used:
    select
    modifier
    from
    modifier
    where
    modifier = 'A'
    and
    level >= 1
    connect by prior
    modifier = parentModifier
    start with
    modifier = 'A'
    order by
    level;
    So, now, I guess the way to do this is perform that query in a trigger before each row is being updated, so the pseudo code would be something like:
    BEFORE UPDATE ON modifier
    FOR EACH ROW
    DECLARE
    modifierToChange varchar2(255);
    modifierList ???;
    BEGIN
    select
    modifier
    into
    modifierList
    from
    modifier
    where
    modifier = 'A'
    and
    level >= 1
    connect by prior
    modifier = parentModifier
    start with
    modifier = 'A'
    order by
    level;
    if modifierToChange in modifierList
    return error
    else
    execute query
    end if
    END
    As you can see my PL/SQL is limitied. At the moment I can handle this at the application layer (in php), but if the admin going to SQL Plus and starts to fiddle, they can easy break the system, by setting an invalid relationship.
    I was wondeirng, if anyone could give me some help or advice, it would be fantastic,
    Thanks!

    Having a unique key on mod_id would be enough to make sure the same element is not in the structure more than once. By allowing it to happed you will have all the descendants of the dup element following it when you walk the tree.
    Let's say this is the intended behavior.
    Consider the following test scenario:
    create table modifier (
      mod_id varchar2(10),
      parent_mod_id varchar2(10)
    insert into modifier (mod_id, parent_mod_id) values ('a', null);
    insert into modifier (mod_id, parent_mod_id) values ('aa', 'a');
    insert into modifier (mod_id, parent_mod_id) values ('ab', 'a');
    insert into modifier (mod_id, parent_mod_id) values ('ac', 'a');
    insert into modifier (mod_id, parent_mod_id) values ('aaa', 'aa');
    insert into modifier (mod_id, parent_mod_id) values ('aab', 'aa');
    insert into modifier (mod_id, parent_mod_id) values ('aac', 'aa');
    insert into modifier (mod_id, parent_mod_id) values ('aba', 'ab');
    insert into modifier (mod_id, parent_mod_id) values ('abb', 'ab');
    insert into modifier (mod_id, parent_mod_id) values ('abc', 'ab');
    insert into modifier (mod_id, parent_mod_id) values ('aca', 'ac');
    insert into modifier (mod_id, parent_mod_id) values ('acb', 'ac');
    insert into modifier (mod_id, parent_mod_id) values ('acc', 'ac');
    insert into modifier (mod_id, parent_mod_id) values ('b', null);
    insert into modifier (mod_id, parent_mod_id) values ('ba', 'b');
    insert into modifier (mod_id, parent_mod_id) values ('bb', 'b');
    insert into modifier (mod_id, parent_mod_id) values ('bc', 'b');
    insert into modifier (mod_id, parent_mod_id) values ('baa', 'ba');
    insert into modifier (mod_id, parent_mod_id) values ('bab', 'ba');
    insert into modifier (mod_id, parent_mod_id) values ('bac', 'ba');
    insert into modifier (mod_id, parent_mod_id) values ('bba', 'bb');
    insert into modifier (mod_id, parent_mod_id) values ('bbb', 'bb');
    insert into modifier (mod_id, parent_mod_id) values ('bbc', 'bb');
    insert into modifier (mod_id, parent_mod_id) values ('bca', 'bc');
    insert into modifier (mod_id, parent_mod_id) values ('bcb', 'bc');
    insert into modifier (mod_id, parent_mod_id) values ('bcc', 'bc');
    commit;
    SQL> select lpad(' ', 2 * (level - 1)) || mod_id item
      2    from modifier
      3   start with parent_mod_id is null
      4  connect by prior mod_id = parent_mod_id;
    ITEM
    a
      aa
        aaa
        aab
        aac
      ab
        aba
        abb
        abc
      ac
        aca
        acb
        acc
    b
      ba
        baa
        bab
        bac
      bb
        bba
        bbb
        bbc
      bc
        bca
        bcb
        bcc
    26 rows selected
    Create a function to verify if a mod_id already is parent_mod_id's ascendant or descendant:
    create or replace function exists_in_parents_branch
      i_mod_id in varchar2
    ,i_parent_mod_id in varchar2
    ) return boolean is
      pragma autonomous_transaction;
      v_dummy varchar2(10);
    begin
      select mod_id
        into v_dummy
        from (select mod_id
                from modifier
               where mod_id = i_mod_id
              connect by prior mod_id = parent_mod_id
               start with mod_id = i_parent_mod_id
              union
              select mod_id
                from modifier
               where mod_id = i_mod_id
              connect by prior parent_mod_id = mod_id
               start with mod_id = i_parent_mod_id);
      return true;
    exception
      when no_data_found then
        return false;
    end exists_in_parents_branch;
    Create a trigger that calls the function above for every insert and update
    create or replace trigger biu_modifier
    before insert or update on modifier
    for each row
    begin
      if exists_in_parents_branch(:new.mod_id, :new.parent_mod_id) then
        raise_application_error(-20000, 'Cannot insert or update because of recursive relationship.');
      end if;
    end biu_modifier;
    You are all set.
    Here is a statement that should fail:
    SQL> insert into modifier (mod_id, parent_mod_id) values ('bcc', 'b');
    insert into modifier (mod_id, parent_mod_id) values ('bcc', 'b')
    ERROR at line 1:
    ORA-20000: Cannot insert or update because of recursive relationship.
    ORA-06512: at "RC.BIU_MODIFIER", line 3
    ORA-04088: error during execution of trigger 'RC.BIU_MODIFIER'
    Here is a statement that should succeed:
    SQL> insert into modifier (mod_id, parent_mod_id) values ('aaaa','aaa');
    1 row created.

  • How to populate a adf tree programmatically

    Hi,
    I am creating a adf tree (single select) which is the menu of my application.
    Each node of my tree is a command link.
    I am reading the data from a table through a view object (adfbc).
    I want to somehow manipulate my managed bean so that I can display selected rows (permission based) in the adf tree.
    If I am using the condition in the rendered attribute then the nodestamp facet is still rendered and there is a blank row displayed for a node which should not be displayed.
    The other way I was thinking to Iterate the entire tree in my managed bean and remove the nodes which should not be displayed.
    This way the tree is manipulated before it is endered and hence it will not have any blank row in the place of nodes not to be shown.
    Please let me know a few iterating code strip and where(in which method) I should put it in my managed bean to make it work?
    As of now I was putting a tree iterator code in the getMenuTree() method of my managed bean where menuTree is the RichTree object for the tree which I have to render in my UI.
    CollectionModel model = (CollectionModel)this.menuTree.getValue;
    treeBinding = (JUCtrlHierBinding)model.getWrappedData();
    JUCtrlHierNodeBinding root = treeBinding.getRootNodeBinding();
    checkPermission(root);
    List<JUCtrlHierNodeBinding> children = root.getChildren();
    if (children != null)
    for (JUCtrlHierNodeBinding _node : children)
    checkPermission(_node);
    checkPermission - is the method which reads few bindings from the node and decides that this node id eligible for display or not based on user permission.
    But with this code I am getting the node hierarchical structure of the selected node only.
    Thanks in advance

    I thought in this direction... but I cannot access the permission data from VO level as I have to provide this menu interface to multiple projects.
    And the menu I am creating is in a template from where I need to get permission bean of various other projects.
    any other suggestions ?

  • [SOLVED] Multiple Dynamic View Objects and View Links - ADF Tree Table

    Hi all,
    I've got a method that creates 3 dynamic viewobjects using this:
                ViewDefImpl Level1ViewDef = new ViewDefImpl("Level1View");
                Level1ViewDef.addViewAttribute("LevelDescription","LEVEL1_DESCRIPTION",String.class);
                Level1ViewDef.addViewAttribute("SetOfBooksId","SET_OF_BOOKS_ID",Number.class);
                Level1ViewDef.addViewAttribute("CodeCombinationId","CODE_COMBINATION_ID",Number.class);
                Level1ViewDef.addViewAttribute("Level1","LEVEL1",String.class);
                Level1ViewDef.addViewAttribute("AccountType","ACCOUNT_TYPE",String.class);
                Level1ViewDef.addViewAttribute("PeriodYear","PERIOD_YEAR",Number.class);
                Level1ViewDef.addViewAttribute("PeriodNum","PERIOD_NUM",Number.class);
                Level1ViewDef.addViewAttribute("PeriodName","PERIOD_NAME",String.class);
                Level1ViewDef.addViewAttribute("PtdActual","PTD_ACTUAL",Number.class);
                Level1ViewDef.addViewAttribute("YtdActual","YTD_ACTUAL",Number.class);
                Level1ViewDef.addViewAttribute("LtdActual","LTD_ACTUAL",Number.class);
                Level1ViewDef.addViewAttribute("BudgetName","BUDGET_NAME",String.class);
                Level1ViewDef.addViewAttribute("BudgetVersionId","BUDGET_VERSION_ID",Number.class);
                Level1ViewDef.addViewAttribute("PtdBudget","PTD_BUDGET",Number.class);
                Level1ViewDef.addViewAttribute("YtdBudget","YTD_BUDGET",Number.class);
                Level1ViewDef.addViewAttribute("LtdBudget","LTD_BUDGET",Number.class);
                Level1ViewDef.addViewAttribute("EncumbranceType","ENCUMBRANCE_TYPE",String.class);
                Level1ViewDef.addViewAttribute("EncumbranceTypeId","ENCUMBRANCE_TYPE_ID",Number.class);
                Level1ViewDef.addViewAttribute("PtdCommitment","PTD_COMMITMENT",Number.class);
                Level1ViewDef.addViewAttribute("YtdCommitment","YTD_COMMITMENT",Number.class);
                Level1ViewDef.addViewAttribute("LtdCommitment","LTD_COMMITMENT",Number.class);
                Level1ViewDef.setQuery(sql_level1);
                Level1ViewDef.setFullSql(true);
                Level1ViewDef.setBindingStyle(SQLBuilder.BINDING_STYLE_ORACLE_NAME);
                Level1ViewDef.resolveDefObject();
                Level1ViewDef.registerDefObject();
                ViewObject vo1 = createViewObject("Level1View",Level1ViewDef);I can create the view objects fine and create a single viewlink between two of them, however i'm getting problems with 2 view links.
    This is how I'm creating a view link:
                ViewLink Level2Level1FKLink = createViewLinkBetweenViewObjects("Level2Level1FKLink1",
                                                        "Level2View",
                                                        vo1,
                                                        new AttributeDef[]{
                                                          vo1.findAttributeDef("Level1")
                                                        vo2,
                                                        new AttributeDef[]{
                                                          vo2.findAttributeDef("Level1")
                                                        "LEVEL1 = :Bind_Level1");
                ViewLink Level3Level2FKLink = createViewLinkBetweenViewObjects("Level3Level2FKLink1",
                                                        "Level3View",
                                                        vo2,
                                                        new AttributeDef[]{
                                                          vo2.findAttributeDef("Level2")
                                                        vo3,
                                                        new AttributeDef[]{
                                                          vo3.findAttributeDef("Level2")
                                                        "LEVEL2 = :Bind_Level2");I can get the data to display on an adf tree table if i'm only using a single view link, but when i try and implement 2 view link (for 3 levels on the adf tree table) i'm getting problems displaying the data.
    I'm getting the following error:
    Aug 10, 2007 2:44:39 PM oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelPartialRootRenderer encodeAll
    SEVERE: Error during partial-page rendering
    oracle.jbo.NoDefException: JBO-25058: Definition Level3View of type Attribute not found in Level2View_Level2Level1FKLink1_Level2ViewThe thing is, Level3View isn't in the Level2Level1FKLink viewlink.
    I've been reading about something similar here
    BC4J Master-Detail-Detail
    but I am still unsure of what the problem is.
    Thanks in advance.

    I found the answer here:
    http://radio.weblogs.com/0118231/stories/2004/06/10/correctlyImplementingMultilevelDynamicMasterDetail.html

  • View Criteria issue on ADF Tree

    Hi,
    JDev 11.1.1.5.0
    I am facing an issue while displaying ADF tree. I've created ParentVO & ChildVO from a single table with view criteria to filter the nodes.And then created two View links ParentToChild & ChildToChild.
    Added VOs & corresponding ViewLinks to ApplicationModule. When I tried to run application module, getting the results as per expectation (applying view criteria at each level).
    Now i've dragged the parent vo from data control on to jspx page. when I run the jspx page, it's displaying the tree structure.
    Issue is only view criteria is applying for top level nodes(parent VO) but not sub levels. If there is some issue with creation of View criteria then it should give same problem while executing AM. But while running AM, getting the expected results.
    It would be great if you provide any clue on this issue
    Thanks,
    Samba

    Thanks for your response.
    But my usecase is different. I need to filter the sublevels of the tree.
    Following is the sample
    Level1
         Level1.1
         Level1.2
         Level1.3
    Level2
         Level2.1
         Level2.2
         Level2.3
         Level2.4
    Level3
         Level3.1
         Level3.2
         Level3.3
    If I gave View Criteria as contains '2' then, Need to filter the nodes contains character 2. Able to filter first level nodes according VC. But VC is not applying for sub levels. Is there any way to set the VC in my case?

  • Question on the ADF Tree Table

    Hi, I am using Jdev 10.1.3.2 and ADF BC. I have created a ADF Tree Table to display multiple attributes, both the master and detail VO are based on the same EO. It seems all of attributes are displayed in one colume, and there is no column heading, is that possible to add column heading and display in multiple columns?
    Thanks!

    Hi,
    actually the node stamp doesn't accept more than one column element
    Frank

  • How can an ADF Tree be configured to work with varying levels of heirarchy?

    We have a need for a Locations tree that represents the Locations heirarchy for any one of our clients. Depending on the client the number of levels in a location heirarchy could range from 1 to 9.
    I have created 9 different tree bindings and I can change the tree binding in the jsp page - the example below is for a client with 4 location levels.
    <af:tree value="#{bindings.ScdLocs4View1.treeModel}" var="node"
    binding="#{backing_locations.tree2}" id="tree2">
    For a client with 5 location levels, I'd like to programatically change the value to
    #{bindings.ScdLocs5View1.treeModel.  How can I do this?
    I was thinking I could use the setValue method on the tree control in my page's backing bean.  But I have been unable to get a reference to the tree binding.
    I don't see an appropriate method for finding a Tree Binding.  There are methods for finding an Iterator Binding, an Executable Binding, or a Region Binding (whatever that is).  But how do I "find" a reference to a Tree Binding?
    I have also given consideration to using a single Tree Binding with 9 levels (or rules in the Tree Binding Editor) and finding a way to  programatically "start" the rendering at a particular level (or rule) - in effect telling the ADF Tree control to ignore some number of rules and begin with the specified rule.  But I haven't been able to figure out how to do this either.
    Help would be greatly appreciated.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Bill,
    A tree binding is a particular kind of control binding, so you can find it as a control binding and then cast it to the more specific interface to work with it.

  • Need help on self referencing a ssrs report

    Hi All,
    I have a graph on one of my report which shows data on level 1 by default and go on showing level 2 and level 3 data on successive clicks. This has been achieved by self referencing a ssrs report and passing respective parameters. Now to identify which level
    data needs to be shown on graph, I have used one more parameter which default value is 1 and go on increasing to 2 then 3 on successive click and this parameter value is used in group expression of graph. This works just fine.
    But the real problem has occurred when you go and select report parameters which are corresponding to level 1, level 2 and level 2 values and click on apply in between. For e.g. Assume level 1=Region, level 2=SubRegion and level 3=Country. When you run this
    report it shows region wise data on graph and value of fourth parameter is 1, now when you click on graph it takes you to level 2 i.e. it shows sub region wise data on graph and value of fourth parameter is 2 but when you go and select all region, sub region
    and countries from report parameters and click on apply button then it should show data on graph region wise but since the time you were selecting parameter data was sub region wise and value of fourth parameter was 2 it shows data for all sub regions which
    is weird and not acceptable at all. 
    I am hoping SSRS should provide a way to pass parameters just like we pass in action on any control within ssrs report to solve this issue. Please help me out to solve this issue or let me know if need more infor.

    Hi,
    There was an error reading from the pipe: Unrecognized error 109 (0x6d).
    One reason was inconsistent binding between client and server <netNamedPipeBinding> <security mode="None"></security>... (no
    communication)
    The other intermittent issue was time-out related.
    For more information, you could refer to:
    http://stackoverflow.com/questions/15836199/wcf-namedpipe-communicationexception-the-pipe-has-been-ended-109-0x6d
    http://stackoverflow.com/questions/22334514/wcf-named-pipe-error-the-pipe-has-been-ended-109-0x6d
    Regards

Maybe you are looking for

  • Safari and airport problems

    Safari started about a month ago getting hung up when loading, ending up with just not loading at all. Then I started getting messages that I was unable to join my network. I can get online at my office wirelessly(different network)but Safari is stil

  • Source file encoding

    Hi all, Here is my problem : Page 1: <%@ page contentType="text/html;charset=UTF8" %> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> </head> <body> ����@� </body> </html> All the special characters display fine. If I

  • Automated FXO Testing?

    I'm looking for a way to automatically test and report on FXO/POTS line failures. I have a client with an extensive SRST deployment and local POTS primarily for 911. Service will largely lay dormant until the critical need arises. Anyone know of a wa

  • Printer error c000

    What does a printer error of C000 for a Canon MG5220 mean?  I am using windows 8.  How do you correct this?

  • What are points and levels?

    Hello, I dont understand what "points" and "levels" are on the apple discussions site? can someone explain