Sorting issue in Pojo Datacontrol Filter-Paging ADF Table

hi,
Created and af:table using sample given at ADF Code Corner 037. How-to build pagination into ADF POJO Data Control(http://www.oracle.com/technetwork/developer-tools/adf/learnmore/37-adf-pojo-pagination-169179.pdf).
with this sample, able to get pagination and implemented filtering by overriding queryListener.
but there is an issue with sorting, even though sortListener() is implemented, when a column is sorted from UI ..
First ADF inbuilt sort is getting called, getAllDepartments(int index, int range) is invoked TotalRecords/Range times.
Second sortListener() method is getting invoked.
is there any way to skip the first step? so that i can write my own Sort logic in SortListener() and trigger the Iterator progrmatically?
-thanks

Hi Arunkumar,
Thanks for your reply. But for custom table, how to create that filter model ?
When i create the table by dragging it from view, filter model is assigned by default to query descriptor.
But for this case, how to set the filterModel attribute ? Do i need to create any custom filter model class here ?
If yes, how to write that. let me know any pointers.
Please let me know in this regard.
Thanks,
Mahipal

Similar Messages

  • Search for any text in column filter on adf table

    Hi,
    I have column filter on adf table where I can search for any text starting with by default.
    For e.g. you have data my name is sam you can search on table column filter by my and you get the results my name is sam
    but I want to search by any word let's say sam and I want to display same result.
    Thank you,
    Savan Shah.

    You probably can use wildcards (% and _ )
    for example %my%
    Dario

  • Issue with ADF table range paging and sorting

    Hello,
    We have a requirement to support pagination in ADF tables. For this, we have made use of Range paging access mode in the view object level. The paging works perfectly fine with this. But we have another requirement of letting the user do a sort on the table (Yes!! The paginated table). The sort should be applied on all rows in the db and the control should return to the first row.
    Applying sort as it is provided by the fwk, sorts the records in the obtained range only. So we have over ridden the Sort listener in Managed bean for this and are able to acheive the sorting of all rows through a AM method call. We are seeing a problem after this. If the sort action is applied to the key attribute then the previous and next range navigation works fine. If the same action is applied to non-key field, then some times (yea!! This is not consistent) the next set is not fetched.
    Here is the code snippet that is called on Next navigation:
    Map<String,Object> pfScope = AdfFacesContext.getCurrentInstance().getPageFlowScope();
    Object objPageNumber = pfScope.get("pageNumber");
    int pageNumber = 0;
    if(null != objPageNumber)
    pageNumber = new Integer(objPageNumber.toString()).intValue();
    BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
    JUCtrlRangeBinding view = (JUCtrlRangeBinding)bindings.getControlBinding("GeDmRequestVO");
    int iRange = getTable().getAutoHeightRows();
    int currentPage = view.getIteratorBinding().getNavigatableRowIterator().getRangeStart()/(iRange + 1);
    System.out.println("Before " + view.getIteratorBinding().getNavigatableRowIterator().getRangeStart());
    System.out.println("Current : " + currentPage);
    System.out.println("Page Number : " + pageNumber);
    System.out.println("Range : " + iRange);
    System.out.println("Value : " + iRange*(currentPage + pageNumber));
    view.getIteratorBinding().getNavigatableRowIterator().scrollRange(iRange*pageNumber);
    System.out.println("After " + view.getIteratorBinding().getNavigatableRowIterator().getRangeStart());
    Although, the new values are not refreshed in the table, the SOPs for before and after print the proper range sizes. And as I mentioned above, the above code works perfectly fine if there is no sort applied or when key attribute is sorted.
    Would appreciate your help on this regard with navigation after non-key attribute sort.
    Thanks,
    Chitra.

    Hi Chitra,
    Can you specify some links to implement RangePaging.....We need to implement pagination.If possible can you share the code or specify the steps how you achieved it.
    Thanks

  • ADF Table Sorting issue

    Hi,
    I have a table that is created from bean data control. When I do sorting on a particular column, the call goes to the bean and it is doing sorting. The sorted data is not getting displayed in the tabel because ADF table is again doing is own sorting and displaying the data. How to display the sorted data comes from the bean and stop table;s in-built sort.
    Thanks,
    $N

    Let me give the actual scnerio,
    1. I need all the columns of the table are sortable, So I made sortable="true" to all the columns.
    2. One of the column is displaying date and time but still the column is string in the table (There is a text box to filter the date not date picker)
    3. When I sort date column ASC/DEC it makes call to the service and the service returns sorted data.
    4. After the data is retrieved from the service, the table is doing its own sorting by taking this column as string(actually)
    5. Finally the table display the data that is sorted by the table itself not the list sorted by the service.
    So the sorting flow happens in this way
    (a) User clicks on Sort in the Table --> (b) Call goes to service to get the sorted data --> (c) Table gets the data from service and does the sort again --> (d)display the data sorted in step(c)
    I want to avoid the step (c) so that the table display the that got in step(b)

  • ADF Table filter issue with OR or AND input value

    Hi all,
    adf:table filterable fields for OR or AND input value not works. Actually One of column is for State and it has "OR" value for -> OREGON State.
    and I tried using filterModel and queryListener for table attribute. But I am not getting exact clue where I need to fix for this issue. Any suggestion and help is appreciated greatly.
    jdev version 11.1.1.3
    Thank you.
    - Robin

    Something like this might work for the one case:
    public void handleQuery(QueryEvent queryEvent){
        // Replace the OR with an equivalent condition
        Map m =
          ((FilterableQueryDescriptor) (queryEvent.getDescriptor())).getFilterCriteria();
        for (Map.Entry entry: (Collection<Map.Entry>) m.entrySet())
          if (entry.getValue() != null &&
              StringUtils.equalsIgnoreCase(entry.getValue().toString(), "OR"))
            entry.setValue("O AND _R");
        // Process The Query
        ELUtils.invokeMethod("#{bindings.VOQuery.processQuery}",
                             QueryEvent.class, queryEvent);
        // Put the OR back
        for (Map.Entry entry: (Collection<Map.Entry>) m.entrySet())
          if (entry.getValue() != null &&
              StringUtils.equalsIgnoreCase(entry.getValue().toString(),
                                           "O AND _R"))
            entry.setValue("OR");
    }

  • Save point with POJO DataControl not saving model state

    Hi Guys,
    JDEV 11.1.1.6 64bit
    I was able to get save points working with ADF BC (AppMod, View & Entity objects)
    but when I tried to do the exact same with Pojo DataControls, I won't save
    the current state of the model - meaning things are not "selected" to the
    proper record when the SP is restored. I don't get any errors, it just
    shows the wrong data.
    Example:
    The BTF is marked as must have transaction(tried either way), but this is Pojo, and doesn't support Trx.
    edit-emp-dept.jspx (with BTF Region)
    BTF START
        STEP 1: RichTable with bindings to Pojo DataControl (value="#{bindings.allDepts.collectionModel}")
                     (user selects the 3 record => sales department)
        STEP 2: Edit Sales Dept & on click to next step create SP
        STEP 3: View Emps (Rich Table of ALL emps in that DEPT)
        STEP 4: Edit Emp
        FINAL: COMMIT (save to pojo list) or CANCEL (don't save to pojo list)
    /BTF END
    At STEP 1 -> STEP 2, the SP is created, and when I close the browser at STEP2, 3  or 4, and
    restart, and choose SP to restore, it takes me to proper page (STEP 2)  but the wrong Department is
    selected to edit (it shows "Finance" instead of "Sales") & if I hit my ADF back button, it shows
    the table with "finance" selected.  In the ADF BC world it works perfectly.
    I know the docs say: the ADF Model is saved, so the question is why bindings.allDepts.collectionModel
    not "saved" here for Pojo DC and the ADF BC af:table value="#{bindings.DepartmentsView1.collectionModel}"
    it is "saved".
    Thanks for any insight or work-around.
    Sincerely,
    Joel
    edit-emp-dept.jspx:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=UTF-8"/>
      <f:view>
        <af:document id="d1">
          <af:form id="f1">
            <af:region value="#{bindings.btfpojodc1.regionModel}" id="r1"/>
          </af:form>
        </af:document>
      </f:view>
    </jsp:root>

    Hi,
    the problem with POJO DC and other non-ADF BC models is that they don't passivate their state. In JDeveloper 12c we allow developers to extend their POJO classes with ADF lifecycle methods that allows them to save the model state themselves. Its a known issue that the transaction state cannot be saved for non-ADF BC models. I checked the bug database for bugs filed against this behavior but could not find one- I can imagine that with 12c we would have a chance to allow developers to handle passivation / activation for non-ADF BC model states. So if this is a feature you need then filing an enhancement request would make sense
    Frank

  • Unable to capture the adf table column sort icons using open script tool

    Hi All,
    I am new to OATS and I am trying to create script for testing ADF application using open script tool. I face issues in recording two events.
    1. I am unable to record the event of clicking adf table column sort icons that exist on the column header. I tried to use the capture tool, but that couldn't help me.
    2. The second issue is I am unable to capture the panel header text. The component can be identified but I was not able to identify the supporting attribute for the header text.

    Hi keerthi,
    1. I have pasted the code for the first issue
    web
                             .button(
                                       122,
                                       "/web:window[@index='0' or @title='Manage Network Targets - Oracle Communications Order and Service Management - Order and Service Management']/web:document[@index='0' or @name='1824fhkchs_6']/web:form[@id='pt1:_UISform1' or @name='pt1:_UISform1' or @index='0']/web:button[@id='pt1:MA:0:n1:1:pt1:qryId1::search' or @value='Search' or @index='3']")
                             .click();
                        adf
                        .table(
                                  "/web:window[@index='0' or @title='Manage Network Targets - Oracle Communications Order and Service Management - Order and Service Management']/web:document[@index='0' or @name='1c9nk1ryzv_6']/web:ADFTable[@absoluteLocator='pt1:MA:n1:pt1:pnlcltn:resId1']")
                        .columnSort("Ascending", "Name" );
         }

  • How to set default sorting order in ADF Table

    Hi,
    I want to set the default sorting order as ascending in adf table. Please help me regarding how can we do it.
    Using JDev 11.1.1.5.0

    Hi Frank,
    Thanks for the quick reply.
    I have done binding of table with list of pojos.
    The Class for which Data control is created is as:-
    public class DemoDC {
        private List<TableEntity> tableList =
            new ArrayList<TableEntity>();
        public List<TableEntity> getTableList() {
            return tableList;
        public void setTableList(List<TableEntity> tableList) {
            this.tableList = tableList;
    where TableEntity is a pojo which has all the columns as its attributes.
    Now when i do the above steps , after clicking on pencil icon and seecting the iterator name in the iterator tab (DemoDC-> tableList) , and selcting the 'sort criteria' tab when i select a column and try to set the sort order  I get error as ' Iterator can not be created for the selected node ' .

  • ADF table sorting

    Hi all!
    How can I sort ADF table by column using select one choise LOV (i.e sort by Name insetad of ID)?

    Hi user,
    check this out.
    Java ADF Webcenter UCM SOA Weblogic: Custom ADF Table Filter with Drop Down , Validation and case insensitive

  • Problem in ADF Table Sorting Accessor Fields Generated from EJB 3

    Here are the things that I have done:
    1) created EJB entities for Employee and Department based on the HR schema
    2) created an HRFacade session bean
    3) generated DataControl
    4) created a browse page
    5) created an adf read only table with the following fields: employeeId, lastname, and departmentName with row selection, filtering and sorting enaabled.
    when I invoke sorting for the employeeId and lastname fields, the table sorts fine, but...
    when I invoke sorting on the departmentName field (an accessor field), the following error occured:
    WARNING: ADF: Adding the following JSF error message: Definition departmentName of type Attribute is not found in employeesFindAll.
    oracle.jbo.NoDefException: JBO-25058: Definition departmentName of type Attribute is not found in employeesFindAll.
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.findAttributeDef(JUCtrlValueBinding.java:589)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.findAttributeDef(JUCtrlValueBinding.java:559)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlRangeBinding.__setSortCriteria(FacesCtrlRangeBinding.java:247)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding$FacesModel.setSortCriteria(FacesCtrlHierBinding.java:346)
         at org.apache.myfaces.trinidad.component.UIXCollection.setSortCriteria(UIXCollection.java:464)
         at org.apache.myfaces.trinidad.component.UIXTable.setSortCriteria(UIXTable.java:196)
         at org.apache.myfaces.trinidad.component.UIXTable.broadcast(UIXTable.java:260)
         at oracle.adf.view.rich.component.UIXTable.broadcast(UIXTable.java:140)
         at oracle.adf.view.rich.component.rich.data.RichTable.broadcast(RichTable.java:364)
         at org.apache.myfaces.trinidad.component.UIXCollection.broadcast(UIXCollection.java:147)
         at org.apache.myfaces.trinidad.component.UIXTable.broadcast(UIXTable.java:271)
         at oracle.adf.view.rich.component.UIXTable.broadcast(UIXTable.java:140)
         at oracle.adf.view.rich.component.rich.data.RichTable.broadcast(RichTable.java:364)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:787)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:280)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:165)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:85)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:54)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.wls.JpsWlsFilter$1.run(JpsWlsFilter.java:96)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.wls.util.JpsWlsUtil.runJaasMode(JpsWlsUtil.java:146)
         at oracle.security.jps.wls.JpsWlsFilter.doFilter(JpsWlsFilter.java:140)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:202)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3588)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2200)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2106)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1428)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Is this a bug or a not supported feature?
    We been stack on this... Help!!!

    I have a similar problem but related to the creation of Project Gantt Chart.
    oracle.jbo.NoDefException: JBO-25058: No se ha encontrado la definición XXXView2 del tipo Atributo en YYYView1.
    this is happened when i try to create a Project Gantt Chart whit 2 view objects that have a parent-child relationship where XXXView2 (SUBTASKS) is the child and YYYView1 (TASK) is the parent.
    still not find the solution.
    This is the bug?

  • Sorting of a column (adf table component) doesn't work in frame

    Hi,
    I just developed a little application with just one query. The results are shown in an adf table component with the possibility of column sorting.
    The application works just fine if i open it with its actual URL, but when I put it in a classic html frameset I'm not able to sort columns anymore.
    The frameset is quite simple. Something like this
    <frameset rows="90%,10%">
    <frame src="header.htm"/>
    <frame src=application URL />
    </frameset>
    I tried to change the targetFrame attribute of the form component but nothing.
    Any idea?
    By the way, I Work with JDeveloper 10.1.3.2.0.4066 and its adf faces components

    Hi,
    I recall an issue in 10.1.3.2 with inner frames that had the wrong JavaScript reference to the DOM. So I assume this to be the same in your case. So you can give it a try with JDeveloper 10.1.3.3 and see if this fixes the problem
    Frank

  • Issue with the last column stretching in ADF table

    There is an issue wherein when  I try stretching the last column of the ADF table to reduce its width it does stretch. But whenever I try stretching it back to this original position it doesn't despite having columnstretching attribute set to multiple and assign widths in percentages to columns . When I set the columnstretching attribute to none, the last column does stretch back and forth but on page load the table does not stretch to its full width despite having styleClass="AFStretchWidth". Now I dont want to be assigning fixed width in pixels to the columns. I would want the last column to stretch back and forth with columnstretching="multiple" and styleClass="AFStretchWidth". I see the same issue on components demo page as well. Tag Guide

    If you are trying that each column gets equally stretched based on the browser, its not possible as adf doesn't supports that.
    If your table is not stretching use styleClass="AFStretchWidth".
    But if all your columns are not stretching you can only try setting column widths + columnStretching property (where you can specify which column to stretch to fill all the spaces)
    Amit

  • Adf table columnStretching issue when using with in panel splitter

    My Scenario is like this:
    I have used adf table with columnStretching to last column of table. And the table is placed at second facet of panelSplitter. On load it covers full area of second facet which is pretty good. When try to collapse panelSplitter, arround 2 pixel of horizontal scrollbar appears at bottom. Even on uncollapse the panelSplitter to original orientation, the extra space remains there which makes horizontal scrollbar with 2 pixel gap for movement at bottom of table.
    Is Anyone facing this kind of issue? And how can I solve the issue?
    Thank you for your help and responses in advance. YOur help will be very much valuable to me.

    Hi Frank,
    I am using FF, Chrome and also IE in different compatibility mode. While wrapping with panelCollection it works fine. But the menu bar section and status bar is introduced on panelCollection which I cannot use in my work.
    -Robin

  • Issue with autosubmit selectchoice in adf table

    I have a column in adf:table which has select choice with autosubmit property set. When the value in the select list changes the table has to refresh and so I have set partialTrigger on table to the select list.
    Now the issue is that when a query is performed and the table refreshes to render the query results, the value change listener of the select choice is invoked with mutiple times (based on number of rows ). The new value of the select choice is null. Why does this happen, how can I avoid it?

    hi ,
    can i see the code of the table ?

  • ADF Table with CheckBox - Select/deselect issue

    I have seen couple of threads and blogs for ADF table with check box . but none of them exactly matching with my requirement . My Database table does not have any field for check box .
    Here is my DB Table
    tableA_
    A_Id
    A_Name
    tableB*
    B_Id
    Requirements :*
    1. Display the above tables data with Checkbox . ( if A_Id = B_Id then the checkbox will be checked , else unchecked ) .
    2. Select / deselect the check box and save the data . Saving the data , will update only tableB . i,e when a new check box is selected then A_Id value will be inserted to tableB . Similarly , deselecting a checked in data will remove the entry from tableB.
    Development :
    1. Created a VO where tableB has marked as updateable .
    2. Created a transient Boolean variable for checkBox . and modified the getter method of checkbox for returning true/false based on the below condition in the ViewRowImpl Class .
    if ( A_Id = B_Id )
    return true;
    else false ;
    3. I have not modified the setter method .
    Using the above concept i can view the data with selected checkbox . but the problem is to save the data . because , when I select a checkbox the above coding in the getter method will return false .
    Therefore , though i am selecting the checkbox but value of the checkbox has been set as false .
    While saving the Data , I am iterating through the VOIterator and observed that a newly selected checkbox value is false . and realized its because of the getter method condition .
    Can you please suggest how can I overcome this issue or shall I need to take any other approach ?
    Jdev version 11.1.1.5
    Regards,
    Amitava
    Edited by: Amitava on Mar 17, 2012 3:48 PM

    You need to go through the ADF page life cycle concepts. In simple words the boolean value in the model is not set while in valueChangeListener. Try adding valueChangeEvent.getComponent().processUpdates(FacesContext.getCurrentInstance()); on top in your listener method and see the effect.
    Reference:
    http://docs.oracle.com/cd/E15051_01/web.1111/b31974/adf_lifecycle.htm

Maybe you are looking for