[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

Similar Messages

  • How to create dynamic View Object and Dynamic Table

    Dear ll
    I want to create a dynamic view object and display the output in a dynamic table on the page.
    I am using Jdeveloper 12c "Studio Edition Version 12.1.2.0.0"
    This what I did:
    1- I created a read only view object with this query "Select sysdate from dual"
    2- I added this View object to the application module
    3- I created a new method that change the query of this View object at runtime
        public void changeVoQuery(String dbViewName) {
            String sqlstm = "Select * From " + dbViewName;
            ViewObject dynamicVo = this.findViewObject("DynamicVo");
            if (dynamicVo != null) {
                dynamicVo.remove();
            dynamicVo = this.createViewObjectFromQueryStmt("DynamicVo", sqlstm);
            dynamicVo.executeQuery();
    4- I run the application module for testing the method and I passed "Scott.Emp" as a parameter and the result was Success
    5- Now I want to show the result of the view on the page, so I draged and dropped the method from the data control as a parameter form
    6- I dragged and dropped the view Object "DynamicVo" as a table and I choose "generate Column Dynamically at runtime". This is the page source
    <af:panelHeader text="#{viewcontrollerBundle.SELECT_DOCUMTN_TYPE}" id="ph1">
            <af:panelFormLayout id="pfl1">
                <af:inputText value="#{bindings.dbViewName.inputValue}" label="#{bindings.dbViewName.hints.label}"
                              required="#{bindings.dbViewName.hints.mandatory}"
                              columns="#{bindings.dbViewName.hints.displayWidth}"
                              maximumLength="#{bindings.dbViewName.hints.precision}"
                              shortDesc="#{bindings.dbViewName.hints.tooltip}" id="it1">
                    <f:validator binding="#{bindings.dbViewName.validator}"/>
                </af:inputText>
                <af:button actionListener="#{bindings.changeVoQuery.execute}" text="changeVoQuery"
                           disabled="#{!bindings.changeVoQuery.enabled}" id="b1"/>
            </af:panelFormLayout>
        </af:panelHeader>
        <af:table value="#{bindings.DynamicVo.collectionModel}" var="row" rows="#{bindings.DynamicVo.rangeSize}"
                  emptyText="#{bindings.DynamicVo.viewable ? 'No data to display.' : 'Access Denied.'}"
                  rowBandingInterval="0" selectedRowKeys="#{bindings.DynamicVo.collectionModel.selectedRow}"
                  selectionListener="#{bindings.DynamicVo.collectionModel.makeCurrent}" rowSelection="single"
                  fetchSize="#{bindings.DynamicVo.rangeSize}" filterModel="#{bindings.DynamicVoQuery.queryDescriptor}"
                  queryListener="#{bindings.DynamicVoQuery.processQuery}" filterVisible="true" varStatus="vs" id="t1"
                  partialTriggers="::b1">
            <af:iterator id="i1" value="#{bindings.DynamicVo.attributesModel.attributes}" var="column">
                <af:column headerText="#{column.label}" sortProperty="#{column.name}" sortable="true" filterable="true"
                           id="c1">
                    <af:dynamicComponent id="d1" attributeModel="#{column}"
                                         value="#{row.bindings[column.name].inputValue}"/>
                </af:column>
            </af:iterator>
        </af:table>
    when I run the page this error is occured
    <Nov 13, 2013 2:51:58 PM AST> <Error> <oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter> <BEA-000000> <ADF_FACES-60096:Server Exception during PPR, #1
    javax.el.ELException: java.lang.NullPointerException
    Caused By: java.lang.NullPointerException
    Can any body help me please
    thanks

    Have you seen Shay's video https://blogs.oracle.com/shay/entry/adf_faces_dynamic_tags_-_for_a
    All you have to do is to use the dynamic table to get your result.
    Timo

  • Iterating through master view objects and child view objects in same page

    I am working on a project using ADF UIX and Business Components.
    I have an application module with two view objects one the master view object and the second the detail object. They are related via a view link.
    I would like to iterate through the master view objects displaying a customer name as bold text and then below each customer name I'd like to display the detail records in a table via the detail view object i.e. a seprate table for each customer.
    Is this possible - I haven't had much luck!?
    Thanks in advance.

    That's because
    $(".ms-vb2 a").
    is bringing back all the pieces that have that class with an anchor on the whole page, not just the ones in the .ms-wpContentDivSpace
    I don't know the exact syntax, but I think you need to iterate through all the '.ms_vb2 a' items as well - there are multiple ones, and do something like this inside your other grouping
    $(".ms-vb2 a").each(function(index) {
        var val=$(this).html();
       var val2=val.replace(/_/g," ")
       $(this).html(val2);
    That's not quite right but maybe that will help.
    Robin

  • How manage materialized view, materialized view logs and db links in Server explorer and Oracle Database Proyect

    Hi,
    We have installed Oracle 12c Oracle Developer Tools for Visual Studio (Visual Studio is 2010 edition). With this tool we can manage tables, views, etc... but we also need to manage more database objects such as materialized views, materialized view logs and db links.
    Is there any option to manage this object from Server Explorer and to add the script in the Database Project? At the same time, the schema compare tools does not include this object types. Is there any option to compare them?
    Thanks.

    As you noticed, not all database objects are available in Server Explorer, and because of this they can't have scripts generated for them, nor can they be compared with Schema Compare.
    In a pinch, you should be able to use SQL Developer to do this.

  • Can Designer generate ADF Entity Objects, View Objects and Apps Module ?

    Hi all,
    On what way can Designer integrate with JDeveloper (+ ADF) ?
    Can Designer generate ADF Entity Objects, View Objects and Apps Module ?
    Thank you for your help,
    xtanto

    Designer itself has no direct integration with JDeveloper. However, there are three options. First of all, you can get a JDeveloper extension (download this separately) that lets you create a Connection to a Designer repository. From that Connection you can find modules that you defined in Designer and generate Entity and View objects for the tables and columns that you used in those modules, and an Application Module. It does not create JSPs or other user interface objects.
    Another option is to buy JHeadstart from Oracle. This contains a set of code generators and ADF extensions that include an ability to get information from a Designer repository. JHeadstart works fine for non-Designer users too, but was built by the same people who wrote Designer Headstart - they know the repository API intimately.
    The third option is to download Oracle Designer Extension Builder (ODEB) which was just recently made available. This is a product of a collaboration between Designer users from the Oracle Development Tools Users Group (ODTUG) and Oracle to extend the capabilities of Designer with user written tools and utilities. You could use ODEB to write your own generators for ADF Business Components. Or you could wait and see if someone else in the user community does this. I hope that you or whoever does such a generator will be willing to share it with us all.

  • Which is better creating view accessor based on view object or view instanc

    When creating view accessors whether in the entity object or in the view object, we have two options:
    1- create the view accessor based on a view object.
    2- create the view accessor based on a view instance.
    what are the differences between these two options?
    what are the cases where I should only use option 1 or option 2?
    which one is better?

    Hello Timo,
    I will try to explain my question better.
    when we create view accessor, after click on create new view accessor icon, the create view accessor window is opened, at the header of this window there is a statement says:
    Select a view object or shared view instance and shuttle it to the selected list to create a view accessor.
    and here is my concern, which one to use
    1- select a view object from one of the available view object and shuttle it to the selected list.
    2- select a view instance from the application module and shuttle it to selected area.
    If you have FOD sample (and I am sure you have it :) ), I see that oracle team has used both of them in different places, for examples
    1- in oracle.fodemo.storefront.entities.PersonEO all view accessors are created from view instance in SharedLookupService application module.
    <ViewAccessor
        Name="PersonTypesVA"
        ViewObjectName="oracle.fodemo.storefront.lookups.LookupsBaseVO"
        AMUsageName="SharedLookupService"
        ViewInstanceName="PersonTypes"/>is it because they are used to create LOV?
    2- in oracle.fodemo.storefront.entities.OrderEO the view accessor is created from a view object, not from instance inside application module.
        <ViewAccessor
        Name="OrdersVO"
        ViewObjectName="oracle.fodemo.storefront.store.queries.OrdersVO"/>I couldn't find the usage of this accessor?
    Hope it is clear now.

  • View objects performance issue with oracle seeded tables

    While i am writing a view object on a oracle seeded tables like MTL_PARAMETERS, its taking more time to show in the oaf page.I am trying to display all these view object columns in detail disclosure of advanced table. My Application is taking more than two minutes to display the view columns of the query which is returning just 200 rows. Please help me how to improve performance when my query using seeded tables.
    This issue is happening only in R12 view object and advanced tables.
    Edited by: vlsn on Jun 24, 2012 11:36 PM

    Hi All,
    Here is architecture of my application:
    Java application creates XML from the screen values and then inserts that XML
    into a framework(separate DB schema) table . then Java calls a Stored Procedure from same framework DB and in SP we have following steps.
    1. It fatches XML from the XML type table and inserts XML into screen specific XML TYPE table in the framework DB Schema. This table has a trigger which parses XML and then inserts XML values into GTT which are created in separate product schemas.
    2. it calls Product SP and then in product SP we have business logic. Product SP
    does the execution and then inserts response into Response GTT.
    3. Response XML is created by using XML generation function and response GTT.
    I hope u will understand my architeture this time and now let me know if GTT are good in this scenario or not. also please not that i need data in GTT only during execution and not after that. i dont want to do specific delete which i have to do if i am using normal tables.
    Regards,
    Vikas Kumar

  • How to set the View instance and view  attribute to lov field ?

    Hi
    I created lov and textfield programatically.
    I want to set the viewattribute and view instance to that items(lovbean, texfieldbean).
    How to set programatically?
    Thanks in Advance
    Awadesh

    Hi
    Thanks. Its working fine. But now i got some another issue.
    after setting, i put simple system.out.println(Pagecontext.getparameter("idoflov"));
    But it returns null value.
    why. Actully i want to pass this value (according to my requirement).
    The view instance and view attribute are setting correctly. But after that i checked means it returns null value .
    plz let me know.
    Thanks

  • Dynamic populate rows and columns in adf table

    Hi everybody !
    I have a query thats returns a unic value !
    and I want to populate an af:table with this value !
    i need to execute this query to get the values for each columns .... and jump to next row and continue to execute the query for new values of the columns of the new row !!!
    in backing bean ... im try to do someting like this :
    RichColumn coluna = new RichColumn();
    coluna.setId("id");
    HtmlOutputText out = new HtmlOutputText();
    out.setId("receive");
    out.setValue("Contas a Receber");
    coluna.getChildren().add(out);
    out = new HtmlOutputText();
    out.setId("pay");
    out.setValue("Contas a Pagar");
    coluna.getChildren().add(out);
    this.getTableFluxo().getChildren().add(coluna);
    but i get the same values for all the rows !!!!

    Hi there,
    If you use ADF BC you can make transient variable in the View Object and fill it in the get method,every time the
    get method is executed you will execute the query and change the value of the new transient variable.
    Even better solutions is to extend the query with this extra column and map the table with it.
    Regards,
    Alexander

  • Displaying active and inactive links in a table.

    Hi all,
    I'm trying to display active links and inactive links in a table.  The problem that I have is that the inactive links are grey, I would like them to appear like normal text in a textview.  From what I understand, I can't have two different celleditor types in the same column, so there goes that idea.
    Does any one have any suggestions on how I may be able to display this intermixing?

    Hi Michael,
    you're right, as for now there is only one cell editor assotiated with one column, probably in near future that won't change.
    Maybe you should try to change the stylesheet of your application?
    Best reagrds,
    Christian

  • How to create Parent and Children is a tree table / trigger sequence number

    How to create Parent and Children is a tree table when the primary key of the parent is generated via a trigger and a sequence number in the database?
    My problem is when I create a parent and then right away a children. The parent still not have a primary key until the transaction get to the database. I get a error when trying the create the children, cannot insert null in the foreign key field of the children.
    Please help.
    Stephane

    You should have the parent key be marked as a DBSequence type.
    Then you should have the association between the master and detail defined as composite association to make sure that the posting order to the database is correct.
    http://download.oracle.com/docs/cd/E24382_01/web.1112/e16182/bcentities.htm#BABFECDJ

  • Dynamic view object and LOV

    Here's the problem I've encountered. I need to create an input LOV, where list is taken from dynamically created view object (it is created using createViewObjectFromQueryStmt; query may be different, but it always has 3 columns with fixed names - that's the rule). The problem is quite similar to that described here: {thread:id=935344}
    I've tried to create a "stub" LOV with a query like
    select 1 ID, 1 RESULTVALUE, 'dynamic' SNAME from dual(all the queries will have 3 columns with names ID, RESULTVALUE and SNAME) and then changing it's query by using something like this
        public void recreateDynamicViewObject(String newSQL) {
            ApplicationModule am = ADFUtils.getApplicationModuleForDataControl(DATACONTROL);               
            if (am.findViewObject(DYNAMIC_VO_NAME) != null)
                am.findViewObject(DYNAMIC_VO_NAME).remove();       
            ViewObject vo = am.createViewObjectFromQueryStmt(DYNAMIC_VO_NAME,newSQL);
            vo.executeQuery();               
        }but it didn't work (with the same results as it was mentioned in the post I've given reference to - the VO changes, but the new rows are not displayed).
    My question is almost the same: is it possible to use a dynamically created VO in LOV? The option of creating a VO for each query is unacceptable in my case, because these queries in fact are created by end users, and there can be any number of these queries.
    In case it is important - I use JDeveloper 11.1.1.2.0.

    I am also looking for a similar solution.
    Actually it works partially.
    I have a created a permanent View Object with a dummy query and in the run time I am replacing the View Object query in the ProcessRequest in CO.
    My problem is when you click on the LOV it works fine with the changed query results, but when I clicked again on the LOV, it shows the the dummy query results which I gave it in the VO.
    Here is my AM method which is called in the CO.
    BOSS_Parameter1_LOV_VOImpl parameterVO =
    getBOSS_Parameter1_LOV_VO1();
    parameterVO.clearCache();
    parameterVO.executeQuery();
    System.out.println(parameterVO.getQuery());
    parameterVO.setWhereClause(null);
    parameterVO.setWhereClauseParams(null);
    parameterVO.setQuery(lovQuery); // this the dynamic query
    parameterVO.setWhereClause(null);
    System.out.println(parameterVO.getQuery());
    Even though its showing the changed query in the getQuery, the LOV is not refreshed.
    I am also changing the Query of the View Object in the ProcessFormRequest
    if (pageContext.isLovEvent() || pageContext.getParameter(EVENT_PARAM).equals("lovPrepare")) {
    call the above mentioned method in the AM.
    But, still it doesn't work.
    Any tips will be appreciated.
    Thanks,

  • View link creation on two view objects, and both view objects are populated program(not from sql)

    I have master and detail VO , both views data is loaded in program. Now for show/hide feature, I create View Link Object and using one element from both child and master VO , View Link Object created properly.
    But I can not able to add that view link object into AM.
    Now because of that , I cannot say what is a instance name of that view link object.
    Hence getting following error  -- Invalid or missing view link. Please attach view link with the bean.
    Please can you provide some directions.

    I have master and detail VO , both views data is loaded in program. Now for show/hide feature, I create View Link Object and using one element from both child and master VO , View Link Object created properly.
    But I can not able to add that view link object into AM.
    Now because of that , I cannot say what is a instance name of that view link object.
    Hence getting following error  -- Invalid or missing view link. Please attach view link with the bean.
    Please can you provide some directions.

  • View Object in the link - CREATION

    Below is the table schema. master1, slave2, cat3 are in the LINK.
    Master1 -----> Slave2 ------> Cat3.
    (id) (id, masterId) (id, slaveId)
    We are having the UIX pages to traverse starting for Master1 and down to Cat3.
    We need to have a url that takes us directly to the Cat3 UIX page.
    ex : www.something.com/catsBrowse.do?catdId=xxx&slaveId=yyy&masterId=zzzz.
    I am trying to initialize the view object. But on executeQuery(). It gives an exception.
    How do I initialize it. Is there any samples available???
    - Thanks.

    Hi,
    using ADF:
    1. Create a page that shows data for cat3
    2. Using the ADF binding (e.f. accessing it from a Struts Action) obtain teh iterator for master1 and set it to a specific row.
    3. Do the same for Detail 2
    4. Navigate to page cat3
    Note that you don't need to access teh VO drectly but can handle this all through the binding framework
    Frank

  • Expert mode query in View objects and appended where clause

    My company is Oracle Member Partner and we are developing enterprise web applications using Oracle database and BC4J.
    I have the following problem...
    When I enable EXPERT MODE option in View Object I have trouble appending to query statement in my client code.
    I need expert mode because I must use "SELECT DISTINCT" insted of "SELECT" in my query.
    It looks something like this:
    viewObject.setWhereClause("CLA_ID = " + claId);
    viewObject.executeQuery();
    SQL query from View Object becomes sub-query and fails to execute:
    select * from (original view object query) where (... appended where clause)
    Order by part of the query causes sql errors because original query is now sub-query.
    Is there any way around this?

    I tried creating an expert mode SQL query:
    SELECT DISTINCT EMPNO, ENAME FROM EMP.
    Then at runtime I do:
    vo.setWhereClause("ENAME LIKE '%'||?||'%');
    vo.setWhereClauseParam(0,'A');.
    and this works fine. The trick is that since expert-mode view objects get wrapped as inline views (to allow runtime appending of WHERE clause, actually), you need to select any column in the select statement to which you want to later refer in a dynamically-appended where clause.
    If you want to prevent the inline-view wrapping, you can write the following code in your view object's ViewObjectImpl subclass to force the VO to NOT be treated as an expert-mode SQL VO.
      // Goes in your view object impl subclass
      public void create() {
         // Force this VO to NOT be treated as an expert-mode SQL, so that
         // its query does not get wrapped as an inline view.
         getViewDef().setFullSql(false);
      }I used this trick above to create an expert mode query like:
    SELECT DISTINCT deptno FROM empand then at runtime I add a dynamic where clause that refers to a column
    in EMP that is not in the select list like this:
        ViewObject vo = am.findViewObject("View1");
        vo.setWhereClause("ename like '%A%'");
        vo.executeQuery();
        System.out.println(vo.first().getAttribute(0));and this causes the query to come out as:
    SELECT DISTINCT deptno FROM emp WHERE ename like '%A%'.
    instead of:
    SELECT * FROM (SELECT DISTINCT deptno FROM emp) QRSLT WHERE ename like '%A%'which would cause an error due to the fact that ename is not in the select list of the original (wrapped, inline) query.

Maybe you are looking for