2 Replies Latest reply: Dec 14, 2012 2:39 PM by DEMR RSS

    RichTable setRowKey(key) issue with regions 11.1.2.x

    DEMR
      Hi, hope we can find a solution here.....

      I have an ADF app, which is working in 11.1.1.6. While migrating to 11.1.2.3 I have issues.

      Let me explain use case:
      I have single page approach with dynamic regions for fragments. In CRUD fragments I have common managed bean for operations such create, edit, delete, etc
      When I use setRowKey(key) method for RichTable instance, it produces an exception:

      +<UIXRegion> <_logIllegalContextChangeMessage>+
      ADF_FACES-10026:During the processing of the region component, either a context change was not found or it did not match the instance set up by the current component.
      Expected oracle.adf.view.rich.component.fragment.UIXRegion$RegionContextChange but found UIXCollection.CollectionComponentChange
      +[Component class: oracle.adf.view.rich.component.rich.data.RichTable, component ID: t1].+

      And then a region exception:

      +<UIXRegion> <getRegionModel>+
      +java.lang.IllegalStateException: The expression "#{bindings.deletetf1.regionModel}" (that was specified for the RegionModel "value" attribute of the region component with id "r1") evaluated to null.+
      +This is typically due to an error in the configuration of the objects referenced by this expression.+
      +If it helps, the expression "#{bindings.deletetf1}" evaluates to "null".+
      +If it helps, the expression "#{bindings}" evaluates to "view_pageDefs_deletePageDef_WEB_INF_deletetf_xml_deletetf". Now using an empty RegionModel instead.+




      To reproduce issue, follow these steps in JDEV 11.1.2.3:

      1) Create a new Fusion Web app (ADF)
      2) In model project, using HR schema, create BC for Departments table
      3) In VC project, create a jsf page with a panelCollection
      4) generate a read only table in panelCollection for Departments with multiple selection enabled
      5) Create a managed bean and assign "bindings" property for the table
      6) add a toolbar in panelCollection, and add two toolbar buttons:
      a) drag and drop delete action from dataControl pannel, departments operations
      b) add a toolbar button, with text delete multiple and with an action listener in the bean used in step 5
      7)implement "delete multiple" button action listener with a code like this (taken from book Oracle Fusion Developer Guide pg 291 "Deleting Multiple Rows from a Managed Bean")

      {code}
      public void deleteMultipleActionListener(ActionEvent actionEvent) {
      // Add event code here...
      //access the RichTable from the JSF component binding
      //created for the table component
      RichTable _table = this.getCoreTable();
      RowKeySet rks = _table.getSelectedRowKeys();

      //iterate over the set of selected row keys and delete
      //each of the found rows
      Iterator selectedRowIterator = rks.iterator();
      while (selectedRowIterator.hasNext()){

      //get the first key
      Object key = selectedRowIterator.next();

      //make the row current
      _table.setRowKey(key);

      //the row is an instance of the ADF node binding class
      JUCtrlHierNodeBinding rowWrapper = null;
      rowWrapper = (JUCtrlHierNodeBinding) _table.getRowData();

      //get the actual oracle.jbo.Row object
      Row row = rowWrapper.getRow();
      row.remove();
      }

      //partially update the ADF Faces Table
      AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
      adfFacesContext.addPartialTarget(_table);
      }
      {code}

      8) Run app, and verifiy it is working fine.
      9) Create a new page fragment, with the same components of the page created before: panelCollection with departments table, toolbar with two delete buttons
      10) Create a new bounded task flow and include fragment as default activity
      11) Create a new jsf page and drag and drop btf to create a region in the page
      12) run app to test the new page. delete button created for single row deletion works fine, but button for multiple rows doesn't work and exceptions mentioned before appear.




      In docs, for ADF_FACES-10026 exception, the suggested action is "Contact to Oracle support". Google search give me some posts but the only solution is to avoid using setRowKey(key) method
      but is not possible to find alternative ways for all scenarios.... so, any idea?

      Thanks,
      DEMR
        • 1. Re: RichTable setRowKey(key) issue with regions 11.1.2.x
          Frank Nimphius-Oracle
          Hi,

          the managed bean that switches the dynamic region, is it in request or backing bean scope? If so then this is the cause of the problem and you should configure that bean for viewScope. If this is the cause of the problem then I doubt that this worked in 11g R1 (11.1.1.6) because it would have the same requirement to the scope oft he bean.

          Note that the error message really is that the region binding resolves to null, not the content in the table

          Frank
          • 2. Re: RichTable setRowKey(key) issue with regions 11.1.2.x
            DEMR
            My dynamic region's bean is configured in viewScope..... so it worked fine in 11.1.1.6

            If you reproduce test case following directions you can reproduce error. In step 11, you could use a static region or a dynamic region, obtaining the same behavior (I did test case with a static region), so I think the region's bean's scope is not the issue here, or static region use managed beans?

            If you noticed, before regions null value error, there is other error, which is the first.

            +<UIXRegion> <_logIllegalContextChangeMessage>+
            ADF_FACES-10026:During the processing of the region component, either a context change was not found or it did not match the instance set up by the current component.
            Expected oracle.adf.view.rich.component.fragment.UIXRegion$RegionContextChange but found UIXCollection.CollectionComponentChange
            +[Component class: oracle.adf.view.rich.component.rich.data.RichTable, component ID: t1].+

            I believe that next region's errors are only consequence of this one.

            This behavior applies to every method which use setRowKey method of RichTable instance. Or, another way to obtain a row key from a RichTable component, for example, invoking table.getRowData() without the need to set current row.

            Any suggestion is appreciated.
            Thanks,
            DEMR