netui-data:pager action to dynamically fetch rows

Hi,
How can I configure a data grid pager to dynamically fetch new rows when a user swap pages through the pager?
I know I can fetch all my rows to a collection / array before rendering the datagrid and set the pager to iterate over it like this:
[Controller]
private List<Ride> rides;
public List<Ride> getRides() {
     return rides;
[Action]
rides = rideDBControl.getAllRides(); // huge amount of data
return forward;
[JSP]
     <div style="border-width:2px;"><netui-data:dataGrid name="currentRidesGrid" dataSource="pageFlow.rides">
          <netui-data:configurePager pagerFormat="prevNext" pageSize="${pageSize}" />
          <netui-data:header>
               <netui-data:headerCell headerText="Name" />
               <netui-data:headerCell headerText="Description" />
          </netui-data:header>
          <netui-data:rows>
               <netui-data:spanCell value="${container.item.name}" style="background-color: #f0f0f0;font-size:14pt;">
               </netui-data:spanCell>
               <netui-data:spanCell value="${container.item.description}">
               </netui-data:spanCell>
          </netui-data:rows>
     </netui-data:dataGrid></div>
But how can I make the pager call a method to update the contents of the collection "rides" according to the current selected page and page size? And how can I obtain the current page and page size inside that method?
I want to paginate queries that may return a huge amount of data (1m + rows), so, fetching all rows at once is impracticable. What I want to do is propagate the current page and page size from the pager to a method that will update the current collection according to a query such as:
Select X, Y, Z
From Table
Where ...
And ROWNUM BETWEEN page * pageSize AND (page + 1) * pageSize
Can anyone help a noob?

For further reference I've found the answer by myself.
To dynamically fetch rows you need to modify the <netui-data:configurePager> tag and include both a pageAction and partialDataSet attributes, e.g.:
<netui-data:configurePager pagerFormat="prevNext" pageSize="${pageSize}" pageAction="pagination" partialDataSet="true" />
Within the pagination action you can obtain the current row and page size from a PagerModel object. You can then update the dataSource (just remember to call the setDataSetSize providing the length of the full dataset so that the pager displays the correct amount of pages), e.g.:
@Jpf.Action(forwards = { @Jpf.Forward(name = "success", navigateTo = Jpf.NavigateTo.currentPage) })
     public Forward pagination() {
          DataGridStateFactory dataGridStateFactory = DataGridStateFactory
                    .getInstance(getRequest());
// Gets the pagerModel object for the grid
          PagerModel pagerModel = dataGridStateFactory.getDataGridState(
                    "currentRidesGrid").getPagerModel();
// => Code to get the entire dataSource size <=
          pagerModel.setDataSetSize(dataSourceSize);
          // Obtain the first row and page size from the model
          int firstRow = pagerModel.getRow();
          int pageSize = pagerModel.getPageSize();
          // => Code to fetch the rows to be displayed <=
          rides = pageRides;
          Forward forward = new Forward("success");
          return forward;
I hope this helps.
Cheers

Similar Messages

  • OnError in form: Error Unable to fetch row

    Hello,
    I'm trying to create such functionality, that in report "edit" link leads to form on another table. Everything is ok with rows, that exist in that table (i can edit them in form). But I want, that if row does not exist - the form should open the "Create record" window.
    Now i get an error:
    ORA-01403: no data found
    Error Unable to fetch row.
    Maybe some computation needs to be done for primary key?
    Thanks.
    Edited by: user11022609 on 2009.4.14 03.38

    I requested for workspace in apex.oracle.com, but i solved the problem sooner. I created one more column ir report (using the unique column left join), which was the primary key of the other table and included it into EDIT link.
    Edited by: user11022609 on 2009.4.14 06.12

  • Row action event on data table does not occur when rows added dynamically

    Row action event on data table does not occur (only refreshes the page) when the rows in the data table are added dynamically at run time using button click and java bean.
    please tell me a way to catch the row click event when adding rows dynamically to data table. i m using RAD 6.0 to develop Faces jsp pages.
    thanks
    amit

    i got the answer

  • Add null rows in WDDOINIT  for fetching data from dynamically added rows..

    Hi,,
    I have to fetch data from a dynamically added rows of a table.
    I have followed / gone through many forums but they ddnot mention how to add null rows in the initialization method..
    I am using WD Abap..
    Can anyone help how to bind null rows in WDDOINIT method..?
    Thanks,
    Surya

    Discussed @ SDN lot of time before. Have a look at any of below threads:-
    Dynamic table in interactive form...
    Make dynamic tables in Adobe Interactive forms
    Adding Rows dynamically upon clicking the button
    How to get values to WebDynpro ABAP from dynamic table?
    Chintan

  • ORA-01403: no data found Problem when using AUTOMATIC ROW FETCH to populate

    ORA-01403: no data found Problem when using AUTOMATIC ROW FETCH to populate a form.
    1) Created a FORM on EMP using the wizards. This creates an AUTOMATIC ROW FETCH
    TABLE NAME - EMP
    Item Containing PRIMARY KEY - P2099_EMPNO
    Primary key column - EMPNO
    By default the automatic fetch has a ‘Process Error Message’ of ‘Unable to fetch row.’
    2) Created a HTML region. Within this region add
    text item P2099_FIND_EMPNO
    Button GET_EMP to submit
    Branch Modified the conditional branch created during button creation to set P2099_EMPNO with &P2099_FIND_EMPNO.
    If I then run the page, enter an existing employee number into P2099_EMPNO and press the GET_EMP button the form is populated correctly. But if I enter an employee that does not exist then I get the oracle error ORA-01403: no data found and no form displayed but a message at the top of the page ‘Action Processed’.I was expecting a blank form to be displayed with the message ‘Unable to fetch row.’
    I can work around this by making the automated fetch conditional so that it checks the row exists first. Modify the Fetch row from EMP automated fetch so that it is conditional
    EXIST (SQL query returns at least one row)
    select 'x'
    from EMP
    where EMPNO = :P2099_EMPNO
    But this means that when the employee exists I must be fetching from the DB twice, once for the condition and then again for the actual row fetch.
    Rather than the above work around is there something I can change so I don’t get the Oracle error? I’m now wondering if the automatic row fetch is only supposed to be used when linking a report to a form and that I should be writing the fetch process manually. The reason I haven’t at the moment is I’m trying to stick with the automatic wizard generation as much as I can.
    Any ideas?
    Thanks Pete

    Hi Mike,
    I've tried doing that but it doesn't seem to make any difference. If I turn debug on it shows below.
    0.05: Computation point: AFTER_HEADER
    0.05: Processing point: AFTER_HEADER
    0.05: ...Process "Fetch Row from EMP": DML_FETCH_ROW (AFTER_HEADER) F|#OWNER#:EMP:P2099_EMPNO:EMPNO
    0.05: Show ERROR page...
    0.05: Performing rollback...
    0.05: Processing point: AFTER_ERROR_HEADER
    I don't really wan't the error page, either nothing with the form not being populated or a message at the top of the page.
    Thanks Pete

  • How to dynamically display the data from a table base on row selection of another table in ADF

    Hi ,
    I have a requirement in ADF. I need to change the data of a table  based on row selection of another Table . Both the table have a Parent Child relationship between them. They have a common attribute say department_id.
                                                                                         For this I created bind variable in view object of employees table and wrote a where clause in the sql query using that bind variable. Then I created method for selection listener of department Table in java bean.
    My method is following
        public void onrowselection(SelectionEvent selectionEvent) {
            RichTable richTable = (RichTable)selectionEvent.getSource();
                            CollectionModel tableModel = (CollectionModel)richTable.getValue();
                            JUCtrlHierBinding adfTableBinding = (JUCtrlHierBinding)tableModel.getWrappedData();
                            Object selectedRowData = richTable.getSelectedRowData();
                            JUCtrlHierNodeBinding nodeBinding = (JUCtrlHierNodeBinding)selectedRowData;
                    oracle.jbo.domain.Number newVal = (oracle.jbo.domain.Number) nodeBinding.getAttribute("DepartmentId");
                    Number pallet = newVal.bigDecimalValue();
                    System.out.println("Selected values " + pallet);
            BindingContext bindingctx = BindingContext.getCurrent();
                          BindingContainer bindings = bindingctx.getCurrentBindingsEntry();
                          DCBindingContainer bindingsImpl = (DCBindingContainer) bindings;
                  DCIteratorBinding dciter = bindingsImpl.findIteratorBinding("EmployeesView1Iterator");//access the iterator by its ID value in the PageDef file
                          ViewObject vo =dciter.getViewObject();
                          vo.setNamedWhereClauseParam("DepartmentId", pallet);//enter your value
                          vo.executeQuery();
    It is printing the selected value of department id from department table in the log. But it is not able to pass the value to employees view. It is showing the following error in the log
    "Definition DepartmentId of type Variable is not found in EmployeesView1."
    I will be very thankful if someone helps me to solve this errror or is there any other way to achieve the same requirement.
    Thanks
    Nilesh

    Note quite sure why you simply wont create a viewlink for the viewobject the tables are based on..
    The viewlink attribute will be based on the departmentId and it's a simple master detail relationship which automatically uses ppr.
    However, if both tables are on the same page; using your hack about;
    On the underlying viewobject, define a viewcriteria e.g. "listById" and set your bind variable here.
    I would bind table two to a RichTable component:
    RichTable t2;
    public void onrowselection(SelectionEvent selectionEvent) {
            RichTable richTable = (RichTable)selectionEvent.getSource();
                            CollectionModel tableModel = (CollectionModel)richTable.getValue();
                            JUCtrlHierBinding adfTableBinding = (JUCtrlHierBinding)tableModel.getWrappedData();
                            Object selectedRowData = richTable.getSelectedRowData();
                            JUCtrlHierNodeBinding nodeBinding = (JUCtrlHierNodeBinding)selectedRowData;
                    oracle.jbo.domain.Number newVal = (oracle.jbo.domain.Number) nodeBinding.getAttribute("DepartmentId");
                    Number pallet = newVal.bigDecimalValue();
                    System.out.println("Selected values " + pallet);
                   refreshTable2(pallet);
            BindingContext bindingctx = BindingContext.getCurrent();
                          BindingContainer bindings = bindingctx.getCurrentBindingsEntry();
                          DCBindingContainer bindingsImpl = (DCBindingContainer) bindings;
                  DCIteratorBinding dciter = bindingsImpl.findIteratorBinding("EmployeesView1Iterator");//access the iterator by its ID value in the PageDef file
                          ViewObject vo =dciter.getViewObject();
                          vo.setNamedWhereClauseParam("DepartmentId", pallet);//enter your value
                          vo.executeQuery();
    private void refreshTable2(Number pallet){
    RichTable x=getT2();
    CollectionModel cm=(CollectionModel)x.getValue();
    JUCtrlHierBinding jcb=(JUCtrlHierBinding)cm.getWrappedData();
    BindingContainer bindings = bindingctx.getCurrentBindingsEntry();
    DCBindingContainer bindingsImpl = (DCBindingContainer) bindings;
    DCIteratorBinding dciter = bindingsImpl.findIteratorBinding(jcb.getName()+"Iterator");
    ViewObject vo =dciter.getViewObject();
    ViewCriteriaManager vcm=vo.getViewCriteriaManager();
    ViewCriteria vc=vcm.getViewCriteria("listById");
    vo.applyViewCriteria(vc);
    vo.setNamedWhereClauseParam("DepartmentId",pallet);
    vo.executeQuery();
    AdfFacesContext.getCurrentInstance().addPartialTarget(getT2());

  • Reading the Data from dynamically added rows of a table...

    Hi,
                  I am using adobe interactive form (WD ABAP) in which i am adding the table rows dynamically (using Jscript code).  I have to fech these data into an internal table. But I can read only the first row data..
                  Also While adding rows dynamically the same data is repeating for the consecutive rows..
                  I have found many similar posts in sdn, but i cannot get the solution. They have mentioned about adding in WDDOINIT method. Can anyone explain me what should be done,..?
    1) How to solve repeatative data while adding rows..?
    2) How to read dynamically added row data during runtime into internal table..?
    Thanks,
    Surya.

    Discussed @ SDN lot of time before. Have a look at any of below threads:-
    Dynamic table in interactive form...
    Make dynamic tables in Adobe Interactive forms
    Adding Rows dynamically upon clicking the button
    How to get values to WebDynpro ABAP from dynamic table?
    Chintan

  • Dynamic Header row for table not aligned properly on 2nd Page

    Hello Friends,
    The problem is like this :
    We have a table with dynamic number of columns and few of them are being hidden at runtime based on a configuration table.
    Now problem while printing is that first page is printing the header row, but same is not being repeated on subsequent pages.
    Please see the layout
    Header row is warped in 2 subforms both are flowed - western text so that they will get squeezed if column is hidden
    Here are the properties for subforms
    1) overflowLeader => Flow top-bottom
    2) OF_SF => Flowed , western text
    On 2nd page all the columns are getting aligned to left hand side whereas printing fine on first page.
    Thanks,
    Nitin

    Hi Nitin,
    in this case, you must use more nested wrapper subforms and set the root subform layout from "flow" to "positioned". I cannot give advice on how the wrapper subforms are organized, since it depends on your logic, just try it out.
    Cheers,
    Tao

  • How to Display string array in jsp page using netui-data:repeater tag ??

    hi,
    I am trying to display a string array in a table using the netui-data:repeater tag.
    I have to use a page flow controller Array(1 Dimensional) to be displayed in the jsp.
    Can any one tell me how to print the array in a table of 3rows & 5 columns.
    Here is the code on which I am crrently working on.
    <netui-data:repeater dataSource="{pageFlow.strWorkObject_Array}">
    <netui-data:repeaterHeader>
    <table cellpadding="4" border="1" class="tablebody">
    </netui-data:repeaterHeader>
    <netui-data:repeaterItem>
    <tr>
    <td><netui:label value="{container.item}" >
    </netui:label></td>
    <td><netui:label value="{container.item}">
    </netui:label></td>
    <td><netui:label value="{container.item}">
    </netui:label></td>
    </tr>
    </netui-data:repeaterItem>
    <netui-data:repeaterFooter>
    </table>
    </netui-data:repeaterFooter>
    </netui-data:repeater>

    weblogic.developer.interest.workshop
    Mansoor Naseem wrote:
    I would like to know where the pageflow newsgroup is.
    These are all the groups in weblogic.developer.interest:
    weblogic.developer.interest.60beta.* (5 groups) weblogic.developer.interest.management
    weblogic.developer.interest.61beta.* (2 groups) weblogic.developer.interest.misc
    weblogic.developer.interest.clustering.* (1 group) weblogic.developer.interest.performance
    weblogic.developer.interest.commerce weblogic.developer.interest.personalization
    weblogic.developer.interest.ejb.* (3 groups) weblogic.developer.interest.portal
    weblogic.developer.interest.environment weblogic.developer.interest.rmi-iiop
    weblogic.developer.interest.jdbc weblogic.developer.interest.security
    weblogic.developer.interest.jms weblogic.developer.interest.servlet
    weblogic.developer.interest.jndi weblogic.developer.interest.tools
    weblogic.developer.interest.jsp weblogic.developer.interest.weblogicenterprise
    MN

  • Dynamic add row/columns to data forms(11.1.1.3) v/s (11.1.2.1)

    Hello All,,
    There used to be an option in Hyperion planning 11.1.1.3 to Dynamic add rows in data form. I don't see this option in planning 11.1.2.1 ?
    Could you please suggest how we can grant right users to add dynamic add rows and columns in data forms? or it is possible in 11.1.2.1 ?
    out user want to have a feature of adding row in data forms (planning forms)
    Thank you
    Edited by: 842804 on Aug 17, 2011 12:49 PM

    Do you mean 11.1.2, if so then adhoc web forms really take over from adding rows as they add much more functionality.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • KNOWN BUG????  data action changing to data page when reload of JDev

    Hi All,
    i'm using jdev 10.1.2, adf bc's, struts, jsp's.
    I have a data action on my struts page which is bound to a method in the app module. I created a class for this data action which overrides the initialMethodParameters() method and gets the arguments for the method in the app module.
    it all works perfectly fine, until i shut down JDev and load it up again. The data action has now turned into a data page. if i dbl click on it i get the create page dialog, instead of the data action class. obviously when i try run this data action, i get cannot display this page error.
    I'm assuming/hoping that this is a bug. can anyone shed any light??
    Thanks in advance,
    Liz

    Hi,
    did you open this in the same version of JDeveloper 10.1.2? I remember that there was a change in Struts between JDeveloper versions
    Frank

  • Data Action is converting in to data page with  parameter="unknown"

    Hi,
    I have created one DataAction, and drag a method from appmoduleImpl on to the created data action. that method contains one parameter as well.
    Now i want to write code in findForward() method on that action class (from gotoCode menu item). After all, if i rebuild it, it is changing to data page from data action with parameter="unknown" and giving me error. In page flow diagram also its showing data page image with Yellow coloured exclamatory mark on it.
    Anybody have any idea ???

    This is the resultant entry in struts config.xml :
    <action path="/editpage" className="oracle.adf.controller.struts.actions.DataActionMapping" type="com.abc.de.testAction" name="DataForm" parameter="unknown">
    <set-property property="modelReference" value="editpageUIModel"/>
    <set-property property="methodName" value="editpageUIModel.getFirstPageDetailsFromId"/>
    <set-property property="resultLocation" value="${requestScope.methodResult}"/>
    <set-property property="numParams" value="1"/>
    <set-property property="paramNames[0]" value="${param.Id}"/>
    <forward name="success" path/firstpage.do"/>
    </action>

  • BUG? Data Action on Struts changing to Data page when i reload Jdev????

    Hi All,
    i'm using jdev 10.1.2, adf bc's, struts, jsp's.
    I have a data action on my struts page which is bound to a method in the app module. I created a class for this data action which overrides the initialMethodParameters() method and gets the arguments for the method in the app module.
    it all works perfectly fine, until i come into work the next day, load up JDev and the data action has now turned into a data page. if i dbl click on it i get the create page dialog, instead of the data action class. obviously when i try run this data action, i get cannot display this page error.
    I'm assuming/hoping that this is a bug. can anyone shed any light??
    Thanks in advance,
    Liz

    Hi,
    did you open this in the same version of JDeveloper 10.1.2? I remember that there was a change in Struts between JDeveloper versions
    Frank

  • Alternating row colors inside netui-data:repeater?

    Is there an easy way to make the row colors alternate inside the netui-data:repeater?
    I am looking for somthing similar to what happens with the netui-data:grid tag.
    A code sample maybe?
    Thanks,
    John

    Hi John,
    This article might help:
    http://dev2dev.bea.com/products/wlworkshop81/articles/repeater.jsp
    "John Hundley" <[email protected]> wrote:
    >
    Is there an easy way to make the row colors alternate inside the netui-data:repeater?
    I am looking for somthing similar to what happens with the netui-data:grid
    tag.
    A code sample maybe?
    Thanks,
    John

  • Dynamic add row/columns to data forms(11.1.1.3) v/s (11.1.1.2)

    Hello All,,
    There used to be an option in Hyperion planning 11.1.1.3 to Dynamic add rows in data form. I dont see this option in planning 11.1.1.2 ?
    Could you please suggest how we can grant right users to add dynamic add rows and columns? or it is possible in 11.1.1.2
    Thank you

    How about ad-hoc analysis? Have a read of this: http://download.oracle.com/docs/cd/E17236_01/epm.1112/hp_user/ch04s02s03.html
    Cheers,
    Mehmet

Maybe you are looking for

  • My avi video files are no longer supported in PRE9? Help!

    I created a movie in premiere elements 9  several months ago.  My video was imported from avi files on my computer.  The avi files were originally downloaded from my camera.  Everything was fine and I even burned a near finished copy of my project on

  • Photoshop CC 2014 64 bit Diffuse Glow Filter looks wrong

    Instead of having the built-in filter, Diffuse Glow produce a glow effect, it lowers the brightness of the non-glowing areas. WTF is wrong with this? Anyone else having this problem?

  • Nokia pc suit for lumia710

    Hello, I expected that lumia710 will give more connect options For pc and s60/Symbian phones but donot know Or able to connect my n73 with lumia710.ok I just want to connect n73 for good sound quality with Lumia710 via Bluetooth. Is it possible? and

  • Changing 'short name' in Admin account?

    I'm using a computer at work that was previously used and administered by a former employee who has since left the company. I need everything to maintain exactly the same settings since I need to work on this computer in the same fashion as the forme

  • Configuration guide for Action Control Matrix

    Hi, Does anyone configuration guide for action control and status matrix for VMS for Equipment master, General Object creation, Master warranty creation and assignement for the object VELO.