Downcasting ViewObject

Hello!
I'm working in a Stuts DataAction, and I'm trying to grab a ViewObject from my ApplicationModule using the findViewObject() method. I need to downcast it to my own specific type to expose a custom method. However, I get a ClassCastException when I try this:
MyViewImpl vo = (MyViewImpl) am.findViewObject("MyView1"); // ClassCastException
So, I generalized the return type just to get something and noticed that
ViewObject vo = am.findViewObject("MyView1"); // executes, but return type is unexpected
returns a class of oracle.jbo.common.ws.WSViewObjectImpl.
What is this class, and why isn't MyViewImpl being used as the type?
Thanks,
-Anthony

Try using the jbo.debugOutput to see what exactly is the syntax of the query you are executing the second time:
http://radio.weblogs.com/0118231/stories/2003/01/17/howToGetMoreDetailsErrorInformation.html

Similar Messages

  • ViewObject is null ?

    I’m developing a jsp application with bc4j using jdev 10g. I have a problem with viewobjects in the application module suddenly becoming null. It doesn't happen every time and it seems to depend on the computer environment as well. It works fine in the development environment, but when I transfer the application to my clients environment I am getting the error. The error happens in dataAction class. I have tried to place the code in findForward method and prepareModel method but the result is the same. Debugging the application I found that mViewObjects and mViewLinks in the application module become null at some point. The action gets executed a couple times and it works fine and then it breaks down.
    I can't see what is causing the problem. Below is the code of the dataAction. 'bindContainer' and 'module' in the prepareModel method are not null, but 'view' becomes null. It is also interesting that the data on the page (from the same view) is displayed correctly.
    public class FindSredstvaViewPageAction extends DataAction
    String page;
    protected void findForward(DataActionContext actionContext) throws Exception
    //Postavi page attribute tako da se otvori stranica na kojoj je current row, SredstvaView
    actionContext.getHttpServletRequest().setAttribute(MyGlobals.PAGE, page);
    // TODO: Override this oracle.adf.controller.struts.actions.DataAction method
    super.findForward(actionContext);
    private String getPage(int index)
    int rows_per_page = MyGlobals.ROWS_PER_PAGE;
    int page = 0;
    while(true)
    if(index < 0) break;
    if(index == 0) // prvi red na strani
    page ++;
    break;
    index = index - rows_per_page;
    page ++;
    return String.valueOf(page);
    protected void prepareModel(DataActionContext actionContext) throws Exception
    DCBindingContainer bindContainer = actionContext.getBindingContainer();
    StalnaSredstvaModuleImpl module = ((StalnaSredstvaModuleImpl)actionContext.getBindingContainer().getApplicationModule());
    SredstvaViewImpl view = module.getSredstvaView();
    page = getPage(view.getCurrentRowIndex());
    // TODO: Override this oracle.adf.controller.struts.actions.DataAction method
    super.prepareModel(actionContext);

    Hi,
    Please use DCDataControl.getDataProvider() to acquire an AM reference. Because your logic is implemented before prepareModel DCBindingContainer may reference an uninitialized AM reference from a previous request (I filed bug 3829746 to resolve this issue).
    Also, it is not recommended that you downcast to an AM "Impl" class in client side code. This will prevent your code from being redeployed in different configurations (immediate vs. batch). Instead of downcasting to the "Impl" class you may export the VO getter to a remote AM interface using the AM wizard and then downcast to the AM interface or use findViewObject(String) on the base ApplicationModule interface.
    Hope this helps,
    JR

  • 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

  • How do I transpose and group a table in a ViewObject?

    Hi,
    I want to transpose and group a table within a view object and don't know how to do it.
    Please let me explain what I want to do:
    One table, e.g. Employees, has one row per employee. Each employee has a departmenent and a room assigned:
    Employee
    Department
    Room
    John
    Finance
    101
    Susie
    Prod
    102
    Hank
    Finance
    103
    Now I want to show one row per departmenent and a marked checkbox for each room that has an employee from this department in it:
    Department
    Room 101
    Room 102
    Room 103
    Finance
    X
    X
    Prod
    X
    What I already did is, I added a transient attribute of type boolean for each room to the ViewObject for employees. I was able to set the booleans within the method ViewObject::createRowFromResultSet. But I still need to do a grouping by department.
    What I don't understand is: is it possible to 1. selecting data, 2. grouping the result and 3. setting booleans for the rooms, anything in the same view object? Or do I need to have two ViewObjects, one that holds the data and another one that prepares and to displays the data?
    Btw. the users will change the checkboxes and the changes must be written back to the database (makes no sense for this example, I know...).
    Could anything be done in the same ViewObject? If so, which methods do I have to overwrite to do the grouping?
    Could someone please give me a hint or let me know where I can find an example of a similar scenario?
    Thanks in advance!

    Sort the playlist into the desired order, e.g. click the heading for the track no. or album columns, the right-click on the playlist name and click Copy to Play Order. The playlist should now burn in the correct order.
    tt2

Maybe you are looking for

  • Best way to refresh page after returning from task flow?

    Hello - (Using jdev 11g release 1) What is the best way to refresh data in a page after navigating to and returning from a task flow with an isolated data control scope where that data is changed and commited to the database? I have 2 bounded task fl

  • /SAPAPO/SDRQCR21 program is not working correctly if we run the program for range of material and plant wise

    Hi APO Experts, In our project, we have received more sales order inconsistencies which is not clearing by CCR program and it is clearing by  program /SAPAPO/SDRQCR21 with option as Build Reqmts from Doc. Flow, So We have decided to schedule the back

  • Can't Get My Dell Downloads to Work

    Hi, I'm new to the community so I have no idea where this topic should be posted (I can't find an appropriate sub-topic under software to post this). Basically my problem is that I can't get My Dell Downloads to register my system so that I can downl

  • Tableview Iterator in BSP

    hi, I hav created a Controller YCL_example and the interface of this class is IF_HTMLB_TABLEVIEW_ITERATOR.I have used the following methods... IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_ROW_START IF_HTMLB_TA

  • Error message popped up when vl06o for picking

    Hi there: When I am executing vl06o to create transfer order for outbound delivery,then I select for picking button and outbound delivery number shows up,so I selected it and click TO in background button,then green check,then I went into create tran