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

Similar Messages

  • EJB-QL with self referencing cmr-field in path identifier fails

    I have a simple application . Only one bean and one relationship. The relationship is a (0..1)-(0..1) for the same bean (self referencing).
    I have a finder method defined with ejb-ql that tries to access the field of one of the cmr fields of the relationship.
    class1Bean is the abstract schema for my bean, and subclass1 is the cmr-field name.
    SELECT OBJECT(obj) FROM class1Bean obj WHERE obj.subclass1.id LIKE ?1
    Here is the error message when trying to deploy:
    Bean: Class1
    Method: java.util.Collection findBySubclass1(java.lang.String)
    EJBQL: SELECT OBJECT(obj) FROM class1Bean obj WHERE obj.subclass1.id LIKE ?1
    Error: JDO75100: Fatal internal error: JDO75341: Missing field meta data for field 'subclass1' of 'Class1'
    This same code deploys fine on JBoss 4.0, and should be legal ejb-ql. Is this a known issue with Sun JSAS?

    Sounds like a problem with the bean metadata. Please check the entity mapping defined in sun-cmp-mappings.xml. Also make sure field sublass1 is defined as CMR everywhere.
    -- markus.

  • Problem with self referencing cells

    Hello there,
    I'd like to have two columns that are NULL, unless the other column has a value entered into it.
    This seems to create an infinite lookup loop of self referencing.
    Can anyone suggest a work around?
    Please see example
    http://public.iwork.com/document/?a=p175104233&d=self_reference.numbers

    If for instance you have
    cell B2 = IF(C2="","","Not Null")
    and
    cell C2 = IF(B2="","", "Not Null")
    then, yes, you have a circular reference
    It sounds like what you want is if you enter (by hand, overwriting the formula that is there) a value in B2 then the formula in C2 will result in a value (not null). If you, instead, enter a value in C2 then the formula in B2 will result in a value.
    Try this addition to the formula:
    B2=IFERROR(IF(C2="","","not null"),"")
    C2=IFERROR(IF(B2="","","not null"),"")
    In other words, wrap it all up in an IFERROR
    Message was edited by: Badunit

  • [PHP-MYSQL] tutorial on using ADDT and dynamic list/form with self-foreign keys?

    Hi all,
    I have a 3 levels catagoris product catalog and would like to manage it
    using dynamic list/forms.
    I'm searching info about using self-foreign keys on dynamic list/forms.
    Is there any tutorial on how to manage this kind of tables using addt?
    tia
    tony

    Hello Tom,
    You were offered the solution on the InterAKT forums, I am not sure why you are posting this problem again. There's also another thread here that presents the same issue and solution:
    http://www.adobeforums.com/cgi-bin/webx/.3bc42a90/0
    Regards,
    Ionut

  • Input form with editble datagrid, but 2 db tables

    Ok, basically it like this. One form called "project" has a
    db table called "project". But there is also a datagrid on the
    'project" form that is called "materials" that is linked to a
    different db table. However both the "materials" and "project"
    tables have a relationship link. Since each "project" record will
    have different "materials".
    How do I set this up in Flex. I can create the "materials"
    datagrid and do stuff stuff like 'add', 'update', and 'delete'. But
    I need to have the datagrid on the same form as "project".
    "Project" will have stuff like 'date', 'time', 'user', 'tasks',
    etc..
    Any help is great
    Thank You

    The problem is not data coming in but inputing data. so when
    the form in populated and the datagrid is populated the recordID of
    the materials table and the recordID of the project table will be
    linked. Then when the project record is retrieved later it will
    have only the materials for that project record in the datagrid.
    | project name field user field date field |
    | |
    | |
    | |
    | |
    | *************************************** |
    | | editable datagrid "materials" | |
    | | | |
    | | | |
    | *************************************** |
    | |
    ---------------------------------------------------------------------------------

  • ORA-02291 during MERGE on self-referenced table

    Hello,
    I encountered error ORA-02291 when I tried to use MERGE statement on the table with "self-referenced" foreign key. Using the foreign key deferrable did not help. The only one thing, which helped me, was using errorlog table. See the demonstration:
    Working as common user:
    SQL> CONNECT scott/tiger
    First of all, I create table and (not deferrable) constraints:
    CREATE TABLE fkv (
         id NUMBER(1) CONSTRAINT nn_fkv_id NOT NULL,
         parent_id NUMBER(1) CONSTRAINT nn_fkv_paid NOT NULL
    ALTER TABLE fkv ADD CONSTRAINT pk_fkv_id PRIMARY KEY (id);
    ALTER TABLE fkv ADD CONSTRAINT fk_fkv_paid FOREIGN KEY (parent_id) REFERENCES fkv(ID) NOT DEFERRABLE;
    INSERT is working well:
    INSERT INTO fkv (
         id,
         parent_id
    SELECT
    1,
    1
    FROM
    DUAL;
    COMMIT;
    1 rows inserted.
    commited.
    MERGE statement using UPDATE branch is working well too:
    MERGE INTO fkv USING (
    SELECT
    1 AS ID,
    1 AS PARENT_ID
    FROM
    DUAL
    ) a
    ON (
    fkv.id = a.id
    WHEN MATCHED THEN
    UPDATE SET
    fkv.parent_id = a.parent_id
    WHERE
    A.ID IS NOT NULL
    DELETE WHERE a.id IS NULL
    WHEN NOT MATCHED THEN
    INSERT (
    ID,
    parent_id
    VALUES (
    A.ID,
    A.PARENT_ID);
    COMMIT;                                        
    1 rows merged.
    commited.
    And now is coming the strange behaviour:
    MERGE INTO fkv USING (
    SELECT
    2 AS id,
    2 AS PARENT_ID
    FROM
    DUAL
    ) a
    ON (
    fkv.id = a.id
    WHEN MATCHED THEN
    UPDATE SET
    fkv.parent_id = a.parent_id
    WHERE
    A.ID IS NOT NULL
    DELETE WHERE a.id IS NULL
    WHEN NOT MATCHED THEN
    INSERT (
    ID,
    parent_id
    VALUES (
    A.ID,
    A.PARENT_ID);
    SQL Error: ORA-02291: integrity constraint (SCOTT.FK_FKV_PAID) violated - parent key not found
    ROLLBACK;
    rollback complete.
    Ok, even it is not a good solution, I try deferrable constraint:
    ALTER TABLE fkv DROP CONSTRAINT fk_fkv_paid;
    ALTER TABLE fkv ADD CONSTRAINT fk_fkv_paid FOREIGN KEY (parent_id) REFERENCES fkv(id) DEFERRABLE INITIALLY DEFERRED;
    table FKV altered.
    table FKV altered.
    MERGE INTO fkv USING (
    SELECT
    2 AS id,
    2 AS PARENT_ID
    FROM
    DUAL
    ) a
    ON (
    fkv.id = a.id
    WHEN MATCHED THEN
    UPDATE SET
    fkv.parent_id = a.parent_id
    WHERE
    A.ID IS NOT NULL
    DELETE WHERE a.id IS NULL
    WHEN NOT MATCHED THEN
    INSERT (
    ID,
    parent_id
    VALUES (
    A.ID,
    A.PARENT_ID);
    1 rows merged.
    COMMIT;
    SQL Error: ORA-02091: transaction rolled back
    ORA-02291: integrity constraint (SCOTT.FK_FKV_PAID) violated - parent key not found
    ... deffered constraint did not help :-(
    Let's try another way - errorlog table; for the first with the not deferrable constraint again:
    ALTER TABLE fkv DROP CONSTRAINT fk_fkv_paid;
    ALTER TABLE fkv ADD CONSTRAINT fk_fkv_paid FOREIGN KEY (parent_id) REFERENCES fkv(ID) NOT DEFERRABLE;
    table FKV altered.
    table FKV altered.
    BEGIN
    sys.dbms_errlog.create_error_log (
    dml_table_name => 'FKV',
    err_log_table_name => 'ERR$_FKV'
    END;
    anonymous block completed
    Toys are prepared, let's start with error logging:
    MERGE INTO fkv USING (
    SELECT
    2 AS id,
    2 AS PARENT_ID
    FROM
    DUAL
    ) a
    ON (
    fkv.id = a.id
    WHEN MATCHED THEN
    UPDATE SET
    fkv.parent_id = a.parent_id
    WHERE
    A.ID IS NOT NULL
    DELETE WHERE a.id IS NULL
    WHEN NOT MATCHED THEN
    INSERT (
    ID,
    parent_id
    VALUES (
    A.ID,
    A.PARENT_ID)
    LOG ERRORS INTO err$_fkv;
    1 rows merged.
    Cannot belive, running SELECT for confirmation:
    SELECT * FROM err$_fkv;                    
    SELECT * FROM fkv;
    no rows selected
    ID PARENT_ID
    1 1
    2 2
    Ok, COMMIT:
    COMMIT;
    commited.
    SELECT for confirmation again:
    SELECT * FROM err$_fkv;                    
    SELECT * FROM fkv;
    no rows selected
    ID PARENT_ID
    1 1
    2 2
    Using deffered constraint and error logging is working well too.
    Metalink and Google did not help me. I am using databases 10.2.0.5 and 11.2.0.3.
    Has somebody encountered this problem too or have I missed something?
    Thank you
    D.

    drop table fkv;
    CREATE TABLE fkv (
    id NUMBER(1) CONSTRAINT nn_fkv_id NOT NULL,
    parent_id NUMBER(1) CONSTRAINT nn_fkv_paid NOT NULL
    CREATE INDEX PK_FKV_ID ON FKV(ID);
    ALTER TABLE fkv ADD CONSTRAINT pk_fkv_id PRIMARY KEY (id);
    ALTER TABLE FKV ADD CONSTRAINT FK_FKV_PAID FOREIGN KEY (PARENT_ID) REFERENCES FKV(ID);Now run your MERGE statement and it works with non deferrable constraints.
    Personally, I would contact support about this before depending on it in production.
    P.S. I was not able to reproduce your findings that dropping and re-adding the constraints changes things. I suspect that when you dropped the constraint the index was NOT dropped, so you kept a non-unique index.
    Try again using ALTER TABLE FKV DROP CONSTRAINT PK_FKV_ID drop index;

  • Tabular form with non base table field

    I want to develop a tabular form with
    1. A non-base table edit field to accept a value
    2. Insert/update another table based on the input value
    3. Also, computed field on each row based on other fields on the records (like post-query trigger in oracle forms at block level - for each row)
    Thanks,
    Rachna

    Thanks for your reply.
    Varad, I like the link you sent me. It has a lot of good information.
    I created a process (under page processing) called "Update/Insert Process" that dosn't seem to be working.
    Question, I created a manual tabular form with SQL Query and created a process (under page processing) called "Update/Insert Process", then I check for each record in the tabular form. If the old value <> new value then I update/insert in the new table.
    Any step by step will be highly apprciated - to create process/validation etc.
    Thanks,
    Rachna

  • DETACHED MODE ON TREE TABLE

    Hi,
    I have an issue with detached mode on Tree table. In one of the page, I'm having a Tree table in Panel Collection with "Detach" enabled. In Tree Table, I have a column "Actions" and it has links for every record. Using these links, user performs operations like 'allocate' and 'de-allocate '.
    I allocated a resource to the Tree table, now the "Deallocate" operation is allowed on that particular row of Tree table.
    Now I click the "Detach" button, Tree table is displayed in Detached Mode. When I click the "De-allocate" link of Tree table, allocated resource is deallocated without issue, but the Tree table no more stays in Detached mode.
    Here whenever user allocates / deallocates resource from Tree table, I refresh the tree table. I use the binding attribute to refresh the Tree table component.
    Can I restrict the Tree table to stay in Detached mode, even after refreshing the component?
    Please let me know if there is any solution.
    Thanks
    Ravi

    Hi,
    do your links perform a page refresh ? Make sure the links have their partialSubmit property set to true as otherwise they perform a full page refresh.
    Frank

  • Sorting columns of Tree table structure

    Hi ,
    We have developed Tree Table structure based on the tutorial, but the data in the columns are not in the right order. Can anyone tell me how to do column sorting for Tree table structure, I know how to do column sorting on normal table structure but that logic does not work for Tree table structures
    Appreciate your help
    Som

    Hi Som,
    If you are using TutWD_TreeByNestingTableColumn project as example, this code can help you:
      //@@begin javadoc:onActionSortTree(ServerEvent)
      /** Declared validating event handler. */
      //@@end
      public void onActionSortTree(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionSortTree(ServerEvent)
         sort(wdContext.nodeCatalogEntries());
        //@@end
      private void sort(IPrivateTreeTableView.ICatalogEntriesNode catalogEntriesNode) {
           if(null==catalogEntriesNode) return;
         catalogEntriesNode.sortElements(COMPORATOR);
         int size = catalogEntriesNode.size();
         for(int i=0;i<size;i++) {
              sort( catalogEntriesNode.nodeChildCatalogEntries(i) );
      private static final Comparator COMPORATOR = new CatalogEntriesComparator();
      private static class CatalogEntriesComparator implements Comparator {
         public int compare(Object o1, Object o2) {
              IPrivateTreeTableView.ICatalogEntriesElement ot1 = (IPrivateTreeTableView.ICatalogEntriesElement)o1;
              IPrivateTreeTableView.ICatalogEntriesElement ot2 = (IPrivateTreeTableView.ICatalogEntriesElement)o2;
              return Collator.getInstance().compare(     ot1!=null ? ot1.getTITLE() : "",
                                                      ot2!=null ? ot2.getTITLE() : "");
         public boolean equals(Object obj) {
              return false;
    Best regards, Maksim Rashchynski.

  • 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! :)

  • 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

  • How-to synchronize edit forms for a single View Object tree node entrie

    Hi all,
    I created a tree from a single View Object,
    follow this [http://www.oracle.com/technetwork/developer-tools/adf/learnmore/32-tree-table-from-single-vo-169174.pdf]
    then i want to create and synchronize edit forms for tree node entries,
    follow this [http://www.oracle.com/technetwork/developer-tools/adf/learnmore/50-synchromize-form-treeselection-169192.pdf]
    but it not working when i click child node!!
    i found the latter tree from many View Object ,but the former tree from single View Object.
    what should i do?
    Thanks in advance

    Hi,
    say the tree is built from ViewObject1. In the AM model, create a second View Object instance for this. Say ViewObject2. Create the form from ViewObject2 and the tree from ViewObject1. When creating the tree, use the"Target Data Source" option at the bottom to reference the iterator of ViewObject2. Then create a PartialTrigger on the paneFormLayout that holds the synch form. In the partial trigger property, reference the tree so that when the tree selection changes, the form is updated. Then create a PartialTrigger property on the tree and point it to the submit button of the form so you can show updated values in the tree.
    Frank

  • How to build a form with a tree component

    Hi, i'd like to know if it's posssible to build a form with
    the Flash 8 Tree component.
    My menu looks like a tree but the childnodes of this tree are
    some form criteria that you can aditionate and post to a serveur.
    I try to use the accordeon menu, and it works but my menu
    must have dynamic heigth, and open all the boxes like the tree
    component...
    I'm in a hole... please healp me...
    Thinks

    Sans,
    I am no Apex expert, but with a situation as "complex" as yours, have you thought about creating a VIEW that joins these 7/8 tables, placing an INSTEAD OF trigger on that view to do all the business logic in the database, and base your application on the view?
    This is the "thick-database" approach that has been gaining momentum of late. The idea is to put your business logic in the database wherever possible, and let the application (Form, Apex, J2EE, whatever) concentrate on UI issues,

  • How to synchronize a cell in form with a cell in MS excel sheet

    dear all
    I can successfuly export data to excell using the ole2 package. But the problem is that exporting data from A datablock in a form to Excel sheet is not enough.
    I need to automaticaly copy updates occures on the datablock to its equilivant in the excel sheet. In other words , i need to synchronize my datablock items with facing cells in the excel sheet,so the cells'values in excel sheet automatiacly changes to be the values in the datablock items
    please help

    Dear all
    I can successfuly export data to excell using the ole2 package. But the problem is that exporting data from A datablock in a form to Excel sheet is not enough.
    I need to automaticaly copy updates occures on the datablock to its equilivant in the excel sheet. In other words , I need to synchronize my datablock items with facing cells in the excel sheet,so the cells'values in excel sheet automatiacly changes to be the values in the datablock items
    I searched the web several times . Some people adviced me to use "Apache-jakarta-poi" . It is a pure java code. But my knoledge in java is limited.I asked on Oracle forums -
    how to synchronize a cell in form with a cell in MS excel sheet - but no one can help
    I tried the oracle forms demo "OLEEXCEL.fmb" . But this form is not working correct .
    I need to embed ole2 in my form that holds excel sheet and passes values from text items to the excel sheet.
    My last try is that I did the following :
    1- in the main canvas i insert the OLE2 control
    2- Right Click and choose insert
    3- from the dialog i chosed Excel Sheet
    4- I placed a button on my canvas then i on the button I write this code
    declare
    worksheet ole2.obj_type;
    cell ole2.obj_type;
    args ole2.list_type;
    begin
    forms_ole2.activate_server('block1.excel_sheet');
    worksheet := forms_ole2.get_interface_pointer('block1.excel');
    args := ole2.create_arglist;
    ole2.add_arg(args,1) -- column1
    ole2.add_arg(args,1) -- cell1
    cell := ole2.invoke_obj(worksheet,'cell',args);
    ole2.destroy_arglist(args);
    ole2.set_property('cell','value',:text1);
    ole2.release_obj(cell);
    ole2.release_obj(worksheet);
    end;
    I get this error ora-305500
    and when i debug , the code stop in this line : cell := ole2.invoke_obj(worksheet,'cell',args);
    please help

  • 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

Maybe you are looking for