serverPaging and pageSize - Forum - Mobile - Progress Community

serverPaging and pageSize

 Forum

serverPaging and pageSize

  • Hi

    When I use a kendo.data.DataSource of type jsdo, and set serverPaging to true and pageSize to something large, I get all the data from my OE Appserver service.

    When I use a progress.data.JSDO({ with the same settings)  I only ever get 100 records.

    How can I get a  progress.data.JSDO datasource to return ALL records to the client? (I am implementing a Kendo PivotGrid hence need all records).

  • Hello,

    I would like to see your code to understand better what you are trying to do.

    By default, the kendo.data.DataSource of type jsdo would return all the records when serverPaging is false.

    Are you trying to use "jsdo" as the type for the PivotDataSource?

    Using "jsdo" as the type of the DataSource for the PivotGrid component is not supported.

    We have a note on this in the documentation:

    documentation.progress.com/.../oemobile1151

    You should be able to use the PivotGrid component by specify the data using the data property of the dataSource.

    The following link lists an example on using the PivotGrid with local data:

       demos.telerik.com/.../local-flat-data-binding

    You can use JSDO (progress.data.JSDO) directly by calling the fill() or read() method to query the records from the server and get all the records locally.

    Then you can use the getData() API of the JSDO to obtain an array with the records and populate the data property.

    Alternatively, you could use an invoke method if you need to return data in a format different than the one used by the JSDO itself.

    Please let me know if you need more information.

    I hope this helps.

  • Hi
     
    Thanks for getting back so quickly.
    Yes I am using a PivotGrid but am binding to a local datasource. I populate this local from a call to get all Persons from an internal OpenEdge service on PAS.
    There are two suprises.
    Firstly that when I had my datasource like below, no matter what I set serverPaging and pageSize to I got 100 records not the full 886:
     
        promise.done(function(jsdosession, result, info){
                   jsdosession.addCatalog(jsdoSettings.catalogURIs)
                        .done(function(jsdosession, result, details)
                                                                {
                                                                mydataSource = new progress.data.JSDO({
                                                                            type: "jsdo",
                                                                           
                                                                            serverPaging:  true,
                                                                            pageSize: 1000,
                                                                //    total: 1000,
                                                                            name: 'Demo.Capita.Person.PersonBusinessEntity',
                                                                            transport: {
                                                                                                    jsdo: "Demo.Capita.Person.PersonBusinessEntity",
                                                                                                    tableRef: "ePerson",
                                                                                                    countFnName: "count" ,
                                                                                                   
                                                                                                                }
     
                                                                            });
                                                                           
                                                                            mydataSource.subscribe('AfterFill', onAfterFillPersons, this);                                                                 
                                                                            mydataSource.fill(); //unfilterd DS
                                                                //          mydataSource.fill(myfilter2);
                                                                })
                            })
     
     
    I changed to use a kendo datasource  as below. It works ONLY when I set the serverPaging to TRUE and the pageSize to a number greater than my count (eg 1000). Setting the serverPaging to false returned 100 records.
    When I get the full 886 records the PivotGrid works well. I have tried the Progress JSDO version 4.0 and 4.1 with same results. The Kendo was   <script src="http://kendo.cdn.telerik.com/2015.2.805/js/kendo.all.min.js"></script>
     
    I have attached the more worrying example using Kendo datasource . You will NOT be able to run as the OE Pas server is internal only, but I hope it helps.
     
      promise.done(function(jsdosession, result, info){
              //     alert('promise done');
                   jsdosession.addCatalog(jsdoSettings.catalogURIs)
                        .done(function(jsdosession, result, details)
                                                                {
                                                                mydataSource = new  kendo.data.DataSource( {
                                                            type: "jsdo",
                                                    // serverPaging:  true,  // WORKS. Gets 886
                                                    //pageSize: 10000,
    // serverPaging:  false,  // DOES NOT WORK. Gets 100
                                                    //pageSize: 10000,
     
     
                                                            transport: {
                                                                jsdo: "Demo.Capita.Person.PersonBusinessEntity",
                                                                tableRef: "ePerson",
                                                                countFnName: "count"
                                                            },
                                                    change: function(d) {
                                                                            // alert('Change: ' + mydataSource.data().length + mydataSource.data()[0].Surname);
                                                                             buildpivot();
                                                                },
                                                                                                                                                               
                                                            error: function(e) {
                                                                alert('Error: ' +  e);
                                                            }
                                                        }
                                        );
     
                                        mydataSource.read();
                            })
                })
     
     
    Thanks again
     
    Ray
     
     
    From: egarcia [mailto:bounce-egarcia@community.progress.com]
    Sent: 04 September 2015 16:57
    To: TU.Mobile@community.progress.com
    Subject: RE: [Technical Users - Mobile] serverPaging and pageSize
     
    Reply by egarcia

    Hello,

    I would like to see your code to understand better what you are trying to do.

    By default, the kendo.data.DataSource of type jsdo would return all the records when serverPaging is false.

    Are you trying to use "jsdo" as the type for the PivotDataSource?

    Using "jsdo" as the type of the DataSource for the PivotGrid component is not supported.

    We have a note on this in the documentation:

    documentation.progress.com/.../oemobile1151

    You should be able to use the PivotGrid component by specify the data using the data property of the dataSource.

    The following link lists an example on using the PivotGrid with local data:

       demos.telerik.com/.../local-flat-data-binding

    You can use JSDO (progress.data.JSDO) directly by calling the fill() or read() method to query the records from the server and get all the records locally.

    Then you can use the getData() API of the JSDO to obtain an array with the records and populate the data property.

    Alternatively, you could use an invoke method if you need to return data in a format different than the one used by the JSDO itself.

    Please let me know if you need more information.

    I hope this helps.

    Stop receiving emails on this subject.

    Flag this post as spam/abuse.

     

    Click here to report this email as spam.



    This email is security checked and subject to the disclaimer on web-page: http://www.capita.co.uk/email-disclaimer.aspx

  • Hello Ray,

    You are welcome.

    Thank you for including the code for the examples. They helped to clarify what is happening.

    It looks like the Business Entity is coded to 100 records when it does not have a filter specified.

    Please notice that only "name" is a valid initialization property in the first example. The other properties are just ignored since the parameter is just an object in JavaScript.

    The fill() method sends a request with a query. Somehow, the code in your Business Entity returns 100 records when a filter is not specified.

    The fill() method also allows an option where a filter object with top and skip can be specified.

    Example:

       jsdo.fill({top: 10000, skip: 0});

    This would solve the issue. However, the real fix would be in the Business Entity code.

    You could look at the network request with the web inspector to see the details of the GET request: the parameters for  the request and data that for the response.

    If needed for debugging, you could just take the request outside the PivotGrid example.

    For instance, you could adapt the following program to test fill() with your Business Entity:

       oemobiledemo.progress.com/.../example013. html

    When you use the Kendo UI DataSource of type "jsdo" with serverPaging false, the code internally, calls fill() with no arguments. The Kendo UI DataSource would apply the pageSize locally to the records returned from the server but in this case it would be 100 records.

    With serverPaging true, the Kendo UI DataSource specifies paging parameters. The code internally, calls fills() using these parameters. If you are using the JSON Filter Pattern (JFP), then the request include top and skip. It would look like { top: 10000, skip: 0} (the Network tab would show this information). The JFP code then would return the records based on these parameters.

    Please take a look at the Business Entity code to see what it does when it does not receive any filter parameters.

    I hope this helps,

    Edsel

  • Thanks
    I will pass on to the team who built the Business Entity.
     
    Ray
     
     
    From: egarcia [mailto:bounce-egarcia@community.progress.com]
    Sent: 07 September 2015 16:40
    To: TU.Mobile@community.progress.com
    Subject: RE: [Technical Users - Mobile] serverPaging and pageSize
     
    Reply by egarcia

    Hello Ray,

    You are welcome.

    Thank you for including the code for the examples. They helped to clarify what is happening.

    It looks like the Business Entity is coded to 100 records when it does not have a filter specified.

    Please notice that only "name" is a valid initialization property in the first example. The other properties are just ignored since the parameter is just an object in JavaScript.

    The fill() method sends a request with a query. Somehow, the code in your Business Entity returns 100 records when a filter is not specified.

    The fill() method also allows an option where a filter object with top and skip can be specified.

    Example:

       jsdo.fill({top: 10000, skip: 0});

    This would solve the issue. However, the real fix would be in the Business Entity code.

    You could look at the network request with the web inspector to see the details of the GET request: the parameters for  the request and data that for the response.

    If needed for debugging, you could just take the request outside the PivotGrid example.

    For instance, you could adapt the following program to test fill() with your Business Entity:

       oemobiledemo.progress.com/.../example013. html

    When you use the Kendo UI DataSource of type "jsdo" with serverPaging false, the code internally, calls fill() with no arguments. The Kendo UI DataSource would apply the pageSize locally to the records returned from the server but in this case it would be 100 records.

    With serverPaging true, the Kendo UI DataSource specifies paging parameters. The code internally, calls fills() using these parameters. If you are using the JSON Filter Pattern (JFP), then the request include top and skip. It would look like { top: 10000, skip: 0} (the Network tab would show this information). The JFP code then would return the records based on these parameters.

    Please take a look at the Business Entity code to see what it does when it does not receive any filter parameters.

    I hope this helps,

    Edsel

    Stop receiving emails on this subject.

    Flag this post as spam/abuse.

     

    Click here to report this email as spam.



    This email is security checked and subject to the disclaimer on web-page: http://www.capita.co.uk/email-disclaimer.aspx

  • Hi Ray, I assume you are using our generic JSDO service: It's designed so that when GET request does not specify the top property, it returns a default maximum of 100 records. So when the Kendo DataSource with the JSDO flavor requests a large top value as part of the JFP you will get more than 100 records.

    Otherwise the limit of 100 records kicks in.

    As a quick for, increase the initial setting of oFetchDataRequest:BatchSize in the GetData method of the Consultingwerk.OERA.JsdoGenericService.Resource class.

    As I'd like to keep a safe maximum of records to be returned to the caller, we should discuss an alternative pattern how a client could request all rows regardless of a top value, maybe something like:

    /Resource/{BusinessEntityName}/all?filter=...

    vs.

    /Resource/{BusinessEntityName}?filter=...

    Architect of the SmartComponent Library and WinKit

    Consultingwerk Ltd.

  • Hi Mike,
    Yes I am using your generic JSDO service. I agree that we should have a separate pattern for the occasions that we want all records returned. There will be few of these I think.
     
    Thanks
     
    Ray
     
     
    From: Mike Fechner [mailto:bounce-mikefechner@community.progress.com]
    Sent: 07 September 2015 17:37
    To: TU.Mobile@community.progress.com
    Subject: RE: [Technical Users - Mobile] serverPaging and pageSize
     
    Reply by Mike Fechner

    Hi Ray, I assume you are using our generic JSDO service: It's designed so that when GET request does not specify the top property, it returns a default maximum of 100 records. So when the Kendo DataSource with the JSDO flavor requests a large top value as part of the JFP you will get more than 100 records.

    Otherwise the limit of 100 records kicks in.

    As a quick for, increase the initial setting of oFetchDataRequest:BatchSize in the GetData method of the Consultingwerk.OERA.JsdoGenericService.Resource class.

    As I'd like to keep a safe maximum of records to be returned to the caller, we should discuss an alternative pattern how a client could request all rows regardless of a top value, maybe something like:

    /Resource/{BusinessEntityName}/all?filter=...

    vs.

    /Resource/{BusinessEntityName}?filter=...

    Stop receiving emails on this subject.

    Flag this post as spam/abuse.

     

    Click here to report this email as spam.



    This email is security checked and subject to the disclaimer on web-page: http://www.capita.co.uk/email-disclaimer.aspx