ViewObject readXml

I'm trying to create some new records using the readXml method of a ViewObject. The xml document contains data from multiple tables linked by foreign keys, e.g., one department with xml elements for all the employees of the department. I've created the xml document using writeXml, so the syntax is correct.
When i try to read the xml, the following exception is displayed:
## Detail 0 ##
oracle.jbo.InvalidOwnerException: JBO-25030: Failed to find or invalidate owning entity.
     at oracle.jbo.server.EntityImpl.internalCreate(EntityImpl.java:513)
     at oracle.jbo.server.EntityImpl.create(EntityImpl.java:377)
     at oracle.jbo.server.EntityImpl.callCreate(EntityImpl.java:395)
If i just load one level of data (by using donorRow.readXML(element, 1)) it works, but i cannot load the detail records.
Btw, the primary key on the master table is generated by a pre-insert trigger on the table.
Also, i noticed that the primary key values of the master table doesn't get set until i commit the record. After posting the primary key is still null. Why?
How do i make this work?
Thanks,
Andrej

Thanks, that helped (i think). I didn't use the dbsequence, but i implemented the create function, which now insert a dummy value.
Reading nested xml still doesn't work though. I dont get error messages, but only the first level of objects is read.
For example, i have a document containing employee, which contain detail view objects, say depts.
The employee is read into a view row, and i can commit it to the database, but the dept aren't created during the readXml.
Is there any documentation or an example on how to do this?
Thanks,
Andrej

Similar Messages

  • Need help in ViewObject Data Validation

    HI Everyone,
    I have few queries about ViewObject. I'm working on JDev11gU2 ADFRC.
    Actually i made an application to upload XLS file to af:table. Everything is working but now I stucked with some functionality. Like -
    1. After inserting all rows in table have opposite sequence as in XLS file, I mean i want to know that is there any way with method VO.readXML() i can
    Insert rows below the previous one. by default it is taking new row as first row in af:table.
    2. Second thing is, I need to show at least 100 lines in af:table by default after uploading data of minimum 3000 lines. So like we had paging functionality in JDev 10g, but in 11g we have scroll and fetch functionality, because of this after loading 100 lines in table my application gets very slow. So any solution to put some same paging functionality like 10g.
    3. Validate all Row attribute in Viewobject, like I have a button say Validate Data, after clicking it all Data of viewobject should validate and if there are any Invalid data. So that Row column should get highlighted. Validation just like before committing data.These are some critical requirement so is there anyone who can guide me properly.
    Thank you,
    Fizzz...

    ok Grant,
    these are all just for explanation only, my exact tables and entity is totally different,
    So just guess i have -
    EmpView(from Employee Entity) - set to show only new inserted rows(Fresh Uncommitted Rows only)
    Attr - EmployeeId (PK)
            EmpName
            DeptId (FK - Department Entity)
            JobId (FK - Job Entity)
            InstId (FK - Institute Entity)
    DeptView(from Departement Entity)
    Attr - DeptId (PK)
            DeptDesc
            InstId (FK - Institute Entity)
    InstView(from Institute Entity) -
    attr - InstId (PK)
            InstDesc
    JobView(from Job Entity) -
    attr - JobId (PK)
            JobDesc
    Now I have one table named *New Employee* on my page to Add more Employees using EmpView ViewObject, For that i have one XLS sheet with all new employee data,
    After Upload XLS File New Employee Table is Like(All Fields are already filled) -
    Line No. EmployeeId           DeptId          InstId       JobId
    1           70021             D10             I01       -->J80
    2           70022          -->D90             I01          J10
    3           70023             D20          -->I20          J20
    4           70024             D30             I03          J10
    5           70025          -->D70          -->I10       -->J50Now what i need is, Suppose
    Invalid Data is (Which Does not exist in their main Table)
    In Line 1 : JobId = J80 (Not exist in Job Entity)
    In Line 2 : DeptId = D90
    In Line 3 : InstId = I20
    In Line 4 : No Error
    In Line 5 : All Three fields have invalid values.
    So now I'm trying to Identify these errors and try to get exact column attribute like above to highlight them in table in red with showing proper formatted msg to user. Like :
    Msg for User :
    These Lines have INVALID DATA :
    Line 1 : JobId,
    Line 2 : DeptId,
    Line 3 : InstId,
    Line 5 : JobId, DeptId and InstId.
    If i do ViewObject Validation then at the time i Uploading process of data from XLS get very slow for large amount of rows like 250<, That's why i was trying to do it after uploading data.
    So after upload i got above table. Now i have a save button where I'm committing data, which calls doDML() method for that Employee entity, where
    suppose process gets error on Line 1 then whole process stops there and throws JboException, and i got Line no 1 for my Msg to show user, but what about other faulty rows,
    For that i catched that exception so after every faulty row process continues, but now the line 4 , which has no error it get committed in DB. I don't want this.
    Another solution i got is use postChange(), but here I'm not getting what I'm doing wrong, problem is it post all previous rows too, suppose i have new 5 lines as shown above but in postChange() method post rest of old lines too. It is making me completely crazy,
    It is very urgent so could not able to find more time to research on this so you please help me, or if you have some examples related to this then please send me the links.
    hope above scenario will help you to understand my problem.
    Thanks
    fizzz...
    Edited by: Fizzz on Jul 8, 2009 1:10 PM

  • Need sample to build one XML doc from 2 ViewObject writeXML

    I just discovered the ViewObject methods readXML and writeXML methods... really neat!.
    I want to package the output from a master writeXML along with its detail writeXML ViewObject into one big XML string to be sent through a queue to another component for further processing. My XML skills are few and new.
    Can anyone supply an example of how to get the composite XMLDocument created and the two writeXML pieces merged? I also need to put in some additional control elements, but I think I could do that part from other examples.
    Thanks,
    Roger

    Roger,
    Our writeXML implemenation will optionally automatically follow view links to render detail information into the XML document for you without "grafting" together two different master and details datagrams yourself.
    If you were working with EMP and DEPT, are you basically trying to create a composite "Department" XML Datagram with nested XML content for the employees in the department, or something else?
    To see what this looks like, create a default entity objects, view objects, and application module using our Business Components Package wizard for the DEPT and EMP tables.
    Right-mouse "Test..." on your AppModuleName appmodule and then "Show..." the master query in the tester.
    Then, select the "View as XML..." option and this will show you was the master/detail xml will look like (it's using writeXML under the covers).

  • Can viewObject get a parameter from sessionScope to binding variable?

    hello,
    using Jdev11g ADF Fusion application
    Can viewObject get a parameter from sessionScope and assign into binding variable ? without using executeWithParameter
    Thanks
    greenApple

    A. Safwat,
    As I said before, I was not trying to be offensive, but simply to explain some of the shortcomings of one solution over another. One of the reasons people give such short answers is that many questions (including this one) have been asked and answered many many many times before on the forum. As to my reasons:
    1). Overkill - overkill because you are writing code to do what the framework already provides for you.
    2). Not bind-variable friendly - you are gluing in literals into a SQL statement. That means that Oracle will have to hard parse the query for each new value of the filter clause, yielding to poor performance, particularly in a multiuser environment. It should ideally be done using bind variables.
    3). Insecure (think about what happens if you put "'xyz' or 1=1" into the filterValue there) - not using bind variables is a security hole. Think through what happens if a filter criteria comes through like the one I mentioned.
    4). Inflexible - because you are overriding executeQueryForCollection, this VO becomes inflexible and can only be used in this particular place. Using the declarative approach outlined by Timo is more flexible
    5). Bad (ok, that's my opinion there) - OK, perhaps this was a bit offensive ;)
    Please don't take a critique of a post as offensive, as I assure you it was not intended to be in that spirit. As I mentioned, I greatly appreciate when people point out issues/problems/etc with my ideas, as that is the best way for me to learn. I have in the past written applications that were not bind-variable friendly, and I learned the downsides the hard way (system was horribly non-performant) - I wish someone had reviewed my approach and told me "bad idea" before the application made it into production.
    Respectfully,
    John

  • Performance problem creating rows on viewobject

    Hi,
    When a user pushes a button in my Oracle ADF 11.1.1.3.0 GUI,
    he triggers a method in my backing bean.
    This method is called insertNewForecastTable, that takes a (Tree)Map called forecastMap as input. (see below)
    ( The key of this map is a Timestamp,
    the value of this map is an object ForecastEntry.
    A ForecastEntry consists out of 10 ForecastParts, and each Forecastpart contains 4 long values. )
    private void insertNewForecastTable(Map forecastMap) {
    DCBindingContainer bc = (DCBindingContainer)getBindings();
    DCIteratorBinding ForecastIter = bc.findIteratorBinding("ForecastViewIterator");
    DCDataControl dc = ForecastIter.getDataControl();
    ApplicationModule am = (ApplicationModule)dc.getDataProvider();
    ViewObject forecastVO = am.findViewObject("ForecastView");
    Set keys = forecastMap.keySet();
    Iterator keyIter = keys.iterator();
    RowSetIterator it = ForecastIter.getRowSetIterator();
    while (keyIter.hasNext()) {
    Long timestamp = (Long)keyIter.next();
    Timestamp ts = new Timestamp(timestamp);
    Row r = it.createRow();
    r.setAttribute(0, ts);
    ForecastEntry forecastentry = (ForecastEntry)forecastMap.get(timestamp);
    int j = 1;
    for (int i=0;i<10;i++) {
    ForecastPart forecastPart = forecastentry.getForecastPart(i);
    r.setAttribute(j,forecastPart.getHistory());
    j++;
    r.setAttribute(j,forecastPart.getForecast());
    j++;
    r.setAttribute(j,forecastPart.getTrend());
    j++;
    r.setAttribute(j,forecastPart.getLimit());
    j++;
    forecastVO.insertRow(r);
    am.getTransaction().commit();
    Configuration.releaseRootApplicationModule(am,true);
    Problem is : for 3360 entries in this table or viewobject, it takes 10 minutes (!!!) to complete this code.
    Bottleneck is the for-loop and the forecastVO.insertRow(r);
    Both timings are rising from 15 msec in the beginning to 500 msec at the end.
    Anyone has some ideas how to improve my performance ?
    Am I doing something wrong trying to create and insert 3360 rows in this table ?
    Thanks.

    Ok,
    My binding is back ok, so the nullpointer is gone.
    But the speed of processing 1000+ inserts into a table is still very poor.
    This is my code at the moment :
      +private void insertNewForecastTable(Map forecastMap) {+
        +DCBindingContainer bc = (DCBindingContainer)getBindings();+
        +DCIteratorBinding ForecastIter = bc.findIteratorBinding("ForecastViewIterator");+
        +DCDataControl dc  = ForecastIter.getDataControl();+
        +ApplicationModule am = (ApplicationModule)dc.getDataProvider();+
        +ViewObject forecastVO = am.findViewObject("ForecastView");+ 
        +RowSetIterator it = ForecastIter.getRowSetIterator();+
        +Set keys = forecastMap.keySet();+        
        +Iterator keyIter = keys.iterator();+
        +List nameList = new ArrayList();+
        +nameList.add("Timestamp");+
        +for (int i=1 ; i<=10; i ++) {+
          +String H = "H"+i;+
          +String F = "F"+i;+
          +String T = "T"+i;+
          +String L = "L"+i;+
          +nameList.add(H);+
          +nameList.add(F);+
          +nameList.add(T);+
          +nameList.add(L);+
        +}+
        +long time_begin = System.currentTimeMillis();+
        +int counter = 0;+
        +// for each timestamp+
        +while (keyIter.hasNext()) {+
          +// Get the timestamp.+
           +Long timestamp = (Long)keyIter.next();+
           +// convert long to timestamp+
           +Timestamp ts = new Timestamp(timestamp);+
           +// create new row in table+
           +Row r = it.createRow();+
          +List valueList = new ArrayList();+
          +valueList.add(ts);+
          +ForecastEntry forecastentry = (ForecastEntry)forecastMap.get(timestamp);+
          +for (int i=0;i<10;i++) {+
              +ForecastPart forecastPart = forecastentry.getForecastPart(i);+
              +valueList.add(forecastPart.getHistory());+
              +valueList.add(forecastPart.getForecast());+
              +valueList.add(forecastPart.getTrend());+
              +valueList.add(forecastPart.getLimit());+
          +}+
          +r.setAttributeValues(nameList, valueList);+
          +forecastVO.insertRow(r);+
          +counter++;+
          +if (counter % 100 == 0) {+
            +am.getTransaction().commit();+
            +System.out.println("Committing rows " + (counter-100) + " to " + counter );+
          +}+
        +}+
        +long time_end = System.currentTimeMillis();+
        +// commit+
        +am.getTransaction().commit();+
       +// Configuration.releaseRootApplicationModule(am,true);+
        +System.out.println("Total time to insert all rows : " + (time_end-time_begin ));+
      +}+It takes up to 500 seconds to insert 3000 rows !
    I also changed the update batch value from 100 to 5, but no difference.
    I'm now also committing every 100 rows.
    And at the end, I get a nullpointer exception at RowDataManager.getRowIndex(RowDataManager.java:191)
    All help welcome.

  • ADF - ViewObject (with Bind Variable) Bind to Table- JDeveloper 10.1.3 EA

    Hi all,
    1.- This is the situation:
    In JDeveloper 10g 10.1.3 EA I have two JSP JSF Pages with bind automatically coponents (backing bean).
    - In the first page I can select a value from a list. Then, when I press the "Accept" ADF Command Button, the selected value is stored in a property called "rutEntidad" of a Session Managed Bean and the Flow Control is passed to the second page.
    - In the second page I have an ADF Table (called tablePolizas) bind to a ViewObject (I drop the ViewObject from the Data Control Palette to the Page - ADF Read-Only Table ). The ViewObject has a Bind Variable called RUT_ENTIDAD. When this page is loaded, value in the rutEntidad property of Session Managed Bean is passed to the ViewObject in order the ADF Table show filtered data . Also in this page there is a "back" ADF Command Button to the first page. The filter mechanism is performed in the getTablePolizas method in the backing bean of the second page, like this:
    //**** The backing bean of the second page *****
    package cl.bicevida.view.backing;
    public class CrearUsuario {
    private CoreTable tablePolizas;
    public CoreTable getTablePolizas() {
    DCBindingContainer dcbc;
    DCControlBinding cb;
    String rutEntidad;
    FacesContext ctx =FacesContext.getCurrentInstance();
    ValueBinding vb =
    ctx.getApplication().createValueBinding("#{SessionManager.rutEntidad}");
    rutEntidad = vb.getValue(ctx).toString();
    dcbc = this.getBindingContainer();
    cb = dcbc.findCtrlBinding("VoPolizasAsociadasEntidadExterna1");
    ViewObject vo = cb.getViewObject();
    vo.setNamedWhereClauseParam("RUT_ENTIDAD", rutEntidad);
    vo.executeQuery();
    return tablePolizas;
    2.- And this is the problem:
    The first time all works fine... then I press the "back" ADF Command Button to the first page (and NOT the back button of the browser). The second time, if the numbers of rows returned by the ViewObject is different than the first time, the application throws this message (but not crash):
    validation - JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=JBO-35007: Row currency has changed since the user interface was rendered. The expected row key was oracle.jbo.Key[1 ]
    validation - JBO-35007: Row currency has changed since the user interface was rendered. The expected row key was oracle.jbo.Key[1 ]
    Well, I had read the "Generic Approach for Back-Button-Friendly Web Rowset Paging" article of Steve Muench in http://www.oracle.com/technology/products/jdev/tips/muench/paging/index.html
    but I think here have another problem.
    3.- The questions:
    Which is the cause of this problem?
    How I can solve it?
    What another way I can programmatic pass a parameter to a ViewObject connected to a table?
    Thanks!!!

    Another thing: the used strategy to obtain a binding container is explained by Steve Muench http://www.oracle.com/technology/products/jdev/tips/muench/1013eabinding/index.html:
    Next, you can use JDeveloper's Overview tab of the faces-config.xml file editor to configure a managed property. Define the managed property name as bindingContainer to match the property in your bean, and set the class to the fully-qualified name of the DCBindingContainer class. You can use the (Browse...) button to quickly locate the class using the new JDeveloper 10.1.3 class browser. Just type in the first few letters of the DCBindingContainer name, and then select the class. Edit the new managed property and set its Value to the JSF EL expression: #{bindings}.
    ************************

  • Where clause with Bind Variable in ViewObject

    As per recomendations from Jdev team they say that using Bind varialbles in where clause will improve the performance (Option 1) But it is causing us to create more view objects.
    Example : Lets say we have a View Object EmpVO
    Option 1:
    ViewObject vo=context.getViewObject("EmpVO");
    vo.setWhereClause("EMPNO=?");
    vo.setWhereClauseParam(0,st);
    (or)
    Option 2:
    vo.setWhereClause("EMPNO="+st);
    If we want to use same View Object "EmpVO" in another Action Class
    ViewObject vo1=context.getViewObject("EmpVO");
    vo1.setWhereClause("DEPTNO=?");
    vo1.setWhereClauseParam(0,str);
    It this case it throws an error saying BIND VARIABLE already exits. So we have to make another View Object.
    Where as if we did not use bind variable but used Option 2 approach the same view object can be used in multiple pages.(at the expense of performance as per Jdev team)
    Are we doing something wrong here or are there other ways to use the same view object when using bind variable in where clause.
    Thanks

    I haven't been using BC4J for a while, but I seem to recall that the recommendations are that you don't set the where clause at runtime: You're supposed to define your view with the bind parameter already in it.
    So you'd probably define an EmpsForEmpNoVO and type "EMPNO = ?" in the where box. (There are other ways of finding a single row/entity and one of those may well be more efficient. Perhaps a better example of where you might want a view of employees is WHERE DEPTNO = ?.)
    IIRC, all instances of a particular type of view share the same definition, so you have to be careful if you alter that at runtime. However, I think everything's set up so that you can have many different (and separate) resultsets for a single view (instance) - meaning that it's possible to "run" a view for (e.g.) two different ids. (It's definitely possible to create two different instances of a view from its definition - and the resultsets will definitely be separate then. I think there's a "create" method on the application module; I remember that "find..." always returns the same instance of the view.)
    Hope that's a push in the right direction (since no-one else had replied - and I hope not too much has changed since 9.0.3)....
    Mike.

  • Create dynamic table at runtime and bind it with ViewObject

    Hi everyone.
    I have the following task.
    I need to create a multiple ViewObjects at runtime (using different constructed sql queries) and then bind ViewObjects with created (also in runtime) tables.
    Tables are to be created on PanelTabbed component. Each tab contains one table.
    So the problem - is there a way to perform this task?
    A portion of code:
    ApplicationModule am = ADFUtils.getApplicationModule("AppModule");
    ViewObjectImpl vo = null;
    if (am.findViewObject("SQLVo") != null)
    am.findViewObject("SQLVo").remove();
    System.out.println("object removed!");
    vo = am.createViewObjectFromQueryStmt("vo", "select ...");
    RichTable newTable = new RichTable();
    newTable.setVar("row");
    newTable.setVarStatus("rowStat");
    RichShowDetailItem newDetItem = new RichShowDetailItem();
    newDetItem.setText("New Detail");
    newTable.setInlineStyle("width:100%;height:180px");
    newTable.setRowSelection("single");
    DCBindingContainer dcBindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    String iterBindingName = vo.getName() + "Iterator";
    JUIteratorBinding iterBinding =
    (JUIteratorBinding)dcBindings.findIteratorBinding(iterBindingName);
    if (iterBinding != null) {
    dcBindings.removeIteratorBinding(iterBindingName);
    BindingContext bcc = (BindingContext)JSFUtils.resolveExpression("#{data}");
    iterBinding =
    new JUIteratorBinding(bcc.findDataControl("AppModuleDataControl"), vo);
    String ctrlBindingName = vo.getName() + "Binding";
    FacesCtrlHierBinding clonedHierBinding =
    (FacesCtrlHierBinding)dcBindings.findCtrlBinding(ctrlBindingName);
    if (clonedHierBinding != null) {
    dcBindings.removeControlBinding(ctrlBindingName);
    =======================================
    Please, look here!
    What's the best practices to create a new FacesCtrlHierBinding?
    What a parameter _nodeBindings (type JUCtrlHierTypeBinding[]) should be?
    =======================================
    clonedHierBinding =
    new FacesCtrlHierBinding(null,
    iterBinding,
    new String[]{
    "BUILDING_ID"
    // "BUILD_NAME",
    // "FUNCTIONALITY_NAME",
    // "CITY_NAME",
    // "STREET_NAME",
    // "FLOORS"
    _nodeBindings
    dcBindings.addControlBinding(ctrlBindingName, clonedHierBinding);
    newTable.setValue(clonedHierBinding.getCollectionModel());
    for (int g=0; g < vo.getAttributeCount(); g++){
    RichColumn col = new RichColumn();
    col.setId("c" + Integer.toString(g));
    col.setHeaderText(vo.getAttributeDef(g).getProperty(AttributeHints.ATTRIBUTE_LABEL).toString());
    ValueExpression valExp =
    facesContext.getApplication().getExpressionFactory().createValueExpression(facesContext.getELContext(),
    "#{row." + vo.getAttributeDef(g).getName() + "}",String.class);
    RichOutputText text = new RichOutputText();
    text.setId(vo.getAttributeDef(g).getName() + "txt");
    text.setValueExpression("value", valExp);
    col.getChildren().add(text);
    newTable.getChildren().add(col);
    newDetItem.getChildren().add(newTable);
    myBean.panelTabbed.getChildren().add(newDetItem);
    ...

    Shay, good day!
    You answer is good, but - it use only one dynamic view (and one table, iterator and FacesModel).
    I have task like topic started have - i need to create some unknows numbers of ViewObject (created by demad) and i must have a FacesModel for each created ViewObject.
    How can we do it?

  • How can I display a ViewObject in 'vertical' table? (11g)

    In our application we have a need to display data that comes from a ViewObject in a 'vertical' table, rather than the standard horizontal layout the <af:table> displays.
    For example, suppose the ViewObject has 3 attributes -- Attr1, Attr2 and Attr3.
    Rather than displaying bound viewObject data in columns that run horizontally such as this:
    (Row1)      Attr1 | Attr2 | Attr3
    (Row2)      Attr1 | Attr2 | Attr3
    (Row3)      Attr1 | Attr2 | Attr3
    ...I we want to display:
    (Row1)
    Attr1
    Attr2
    Attr3
    (Row2)
    Attr1
    Attr2
    Attr3
    (Row3)
    Attr1
    Attr2
    Attr3
    ...Is it possible to achieve this using the af:table tag and monkeying with the css styles or is there another tag suited for this such as the forEach tag?
    Does anyone have experience with this? Thanks in advance

    Well, you can use just one <af:column, and put all the attributes under it... can even try using some grouplayout -vertical..
    <af:table value="#{bindings.Something.collectionModel}"   var="row">
       <af:column>
          <af:panelGroupLayout layout="vertical">
             <af:activeOutputText value="#{row.bindings.column1.inputValue}" id="aot1"/>
             <af:activeOutputText value="#{row.bindings.column2.inputValue}" id="aot2"/>
             <af:activeOutputText value="#{row.bindings.column3.inputValue}" id="aot3"/>
          </af:panelGroupLayout>
       </af:column>
    </af:table>                   Should definitely work
    Julian

  • How to get a single row column from a viewobject in java?

    I have a class file that goes out and gets a viewobject and sets its where clause
    this is it:
    vcRow = vc.createViewCriteriaRow();
    vcRow.setAttribute("LogonId", "='" + strPcis_Login.toUpperCase() + "'");
    vc.addElement(vcRow);
    vo.applyViewCriteria(vc);
    vo.executeQuery();
    I know this working cause I can watch it in debug..
    but now the problem.
    I've looked in the docs and don't see how one can pull the value of the row it found and place it in a uix page in a textinput area
    how can I get a single row column, in this case the UserName that is in the view object to a string and then place it into my
    uix page? I've looked and looked and don't see a method for this.
    is there a way to take the oracle.cabo.servlet.Page and set a textinput with a viewobject get method?
    what way do you do this and where is it documented?

    is there a way to take the oracle.cabo.servlet.Page and set a textinput with a viewobject get method?
    what way do you do this and where is it documented? What you can do is get the value from your VO and set it somewhere that UIX can data bind to -- as a Page proprety, on HttpSession, etc. This is documented in Chapters 4 (Data Binding) and 5 (Controller) of the UIX Developer's Guide.
    To set a property, you use Page.setProperty(String key, String value). Then, in your UIX file, to make a textInput that has the value pulled from a given page property, use:
    <textInput data:text="key@ctrl:page" />
    -brian
    Team UIX

  • How to create a viewobject dynamically without using wizard

    Hi,
    I am Using jDEV 11G, i need to create a viewobject dynamically without using wizard, without binding from any entity.
    Actually my intention is to make a grid like in .Net, when a user want to create a new row in RichTable without using DB.
    just like shopping cart.
    i have done thsi code:
    ViewObjectImpl view=new ViewObjectImpl();
    view.addDynamicAttributeWithType("Att1","String",null);
    view.addDynamicAttributeWithType("Att2","String",null);
    view.addDynamicAttributeWithType("Att2","String",null);
    Row rw=view.createRow();
    rw.setAttribute("Att1","First1");
    rw.setAttribute("Att2","First2");
    rw.setAttribute("Att2","First3");
    view.insertRow(rw);
    I have a RichTable , i need bind this viewobject into that.
    Edited by: vipin k raghav on Mar 10, 2009 11:39 PM

    Hi Vipin,
    You can create the view object with rows populated at run time.
    [http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcquerying.htm#CEGCGFCA]
    For reference of how to create an empty rwo at run time on button click
    [http://kohlivikram.blogspot.com/2008/10/add-new-row-in-adf-table-on-button.html]
    ~Vikram

  • Show master and detail viewobjects in the same jsp

    I have two viewobjects which have a master-detail relationship (a viewlink between them).
    What I want to do is to show both the master and the detail data in the same jsp, i.e for every row in the master viewobject I want to show all the rows in the detail viewobject.
    I tried to drop the master vo on the page from the component palette and then the detail vo next to the master vo, but then only the first row in the detail vo is shown on the page. I want all of them to be shown.
    Can anyone please point me in the right direction here?
    Ps: I'm using JDeveloper version 9.0.5.2
    Thanx a lot
    Tom

    I dropped both viewobjects as read-only tables and they both have the rangesize set to -1.
    I think I made myself a bit unclear when asking my question. I do not want a "normal" master-detail view in my jsp where you see one masterrow and all the detailrows. I want my page to show all the masterrows with all their corresponding detail rows listed under the master row.
    The pseudocode may look like this:
    for each row in MasterViewObject loop
    <<display data in MasterViewObject>>
    for each row in DetailViewObject loop
    <<display data in DetailViewObject>>
    end inner loop
    end outer loop
    As you see I have a double loop here. Is somehing like this possible without "manually" doing all the stuff?
    Thanx
    Tom

  • ADF Toystore question:  no blank row in viewobject on "Add" JSP form

    A new thread based on Suggestions for Automatic Commit/Rollback
    In the ADF Toystore application, I did not notice the blank row behavior in the user registration section like we encountered in the other thread posting (Suggestions for Automatic Commit/Rollback To test this, I created another instance of the Accounts viewobject (called it AllAccounts) inside the ToyStoreService app module and then created a JSP to list the contents of the AllAccounts viewobject. Then, I went to the registration page (which creates a blank row in the view object with a status of STATUS_INITIALIZED) and then without submitting the form, I clicked on the link that I created to view the contents of the AllAccounts view object and noticed that a blank row did not appear. What is causing a blank row to appear in our discussions in the other thread (Suggestions for Automatic Commit/Rollback but not in the ADF Toystore application? I guess somehow this row with a status of STATUS_INITIALIZED is being "removed" but I cannot find the code that does this.
    Steve -- any ideas?

    I was trying to figure out what would be the best practice to implement 'partial rollback'. Could not really find the example in Toy Store demo. For example if we create new account, the model will get dirty. And let's say user does NOT commit the record but rather uses link and navigates to some other pages. After some work user may commit the transaction which in turn will commit blank entry in account table. Well for the sake of example let's assume that this is possible scenario.
    So what I am up to is how to implement 'cancel' operation when user changes his/her mind and does something else rather then commit/save_changes in new/edit screens? What would be the best practice?
    What I have done so far is rather too bulky. I have implemented event handler for all my links and cancel button in data page:
       * "Cancel" Event Handler.
       * @param ctx The DataAction context
      public void onCancel(DataActionContext ctx) {
        HttpServletRequest request = ctx.getHttpServletRequest();
        BindingContext bcc = HttpBindingContext.getContext(request);
        DCBindingContainer dbc = DCUtil.findBindingContainer(bcc, "modifyAddSchedulingUIModel");   
        DCIteratorBinding studentCat = dbc.getIteratorBinding("AddModifyScheduleView1",null , "AddModifyScheduleView1Iterator");
        Row currentRow = studentCat.getNavigatableRowIterator().getCurrentRow();   
        currentRow.refresh(Row.REFRESH_REMOVE_NEW_ROWS | Row.REFRESH_WITH_DB_FORGET_CHANGES);
        dbc.getApplicationModule().getTransaction().commit();
        String target = "individual";
        ctx.setActionForward(target);
      Any other idea?

  • How can I control the init of a ViewObject in UIX?

    I want to set the query condition of a ViewObject when UIX file opens.How can I do it?
    Thanks in advance

    You can use a "null" event handler, which will fire
    when there isn't any event; that handler could
    use <bc4j:findByExample> to pick an individual
    row or set of rows.

  • How to get values in table using viewobject ?

    hi,iam using jdev 11.1.2.3.0
    my requirement as follows ..
    i have login form with  username and password and i was gave the option of forgot password.when ever the user clicks the forgot password link .i need to get the data from smtp configuration table(consists smtp port,smtp host,usermail,password) based on the usermail i need to get the data from the smtp table .
    when ever the user clicks forgot password it wil send the password to the respected email id given in the smtp tablem how tom achieve this requirement using view object ..............

    Hi,
    1. create VO and define Ciew Criteria to query rows based on a bind variable
    2. Go to Application Module and select VO, then press Edit button to associate View Criteria
    3. Build public method in Application Module Impl class to take user name as an input argument
    4. Expose this method on the AM client interface (also shown on the Java category of the AM editor)
    5. In the method, use this this.findViewObject("instance name"); to get a hold onto the VO
    6. Add the user name to the bind variable using the viewObject.getVariableManager()
    7. Execute VO
    8. get first row
    9. send mail
    10. Drag and drop method from the Data Control panel to your login page
    11. Use EL to reference the username provided by the user (managed bean reference?)
    This should be it
    Frank

Maybe you are looking for