Mobile 11.7 filtering - Forum - Mobile - Progress Community

Mobile 11.7 filtering

 Forum

Mobile 11.7 filtering

This question is not answered

HI

Upgraded openedge from 11.3 to 11.7. IT appears now  where we are fetching data our filter is returning the following in the backend when i message it out -> [object Object].

$('#trackGrid').kendoGrid({
dataSource: {
type: "jsdo",
transport: {
jsdo: "beTrackPslp"
},
var pickFilter = returnUserField('useraccno');
$("#trackGrid").data("kendoGrid").dataSource.filter(pickFilter);

Advice on what has happenend and how do we work with this would be great.

Tia

All Replies
  • Hello,

    Did you only change the backend or did you change other components on the client side or new libraries?

    How does the payload for the HTTP requests look like in the Network tab?

    Do you get the same query parameters and response?

    What is the value of pickFilter?

    Does this value look the same with your new set up as with the one before?

    The value of pickFilter should use the filter format from the Kendo UI DataSource.

    Links:

    docs.telerik.com/.../datasource

    docs.telerik.com/.../datasource

    By default the Kendo UI DataSource does filtering on the client side.

    Seeing "[object Object]" on the server, it means that the options for serverFiltering must be set to true.

    Could you confirm if serverFiltering is set to true?

    If your intention is to do server-side processing (serverPaging, serverFiltering and serverSorting), then you would need code in the Business Entity to process the filter expression.

    You can write your own code or use the JSON Filter Pattern to process it.

    Here is a link to a sample in the documentation:

    documentation.progress.com/.../index.html

    I hope this helps.

  • Hi

    Yes server filtering is turned on. below is the code:

    detailRow.find(".other-details").kendoGrid({

                   dataSource: {

                       type: "jsdo",

                       serverFiltering: true,

                       transport: {

                           jsdo: "bePsmemo",

                       },

                       filter: { field: "ttpartno", operator: "startswith", value: "vPart" }

           ,

        schema: {

         model: {

          fields: {

           ttpartno: {

            type: 'string'

           },

           ttinfo1: {

            type: 'string'

           },

           ttinfo2: {

            type: 'string'

           }

          }

         },

        },

    },

    scrollable: false,

    sortable: true,            

    columns: [{

    field: "ttinfo1",

    title: "Details"

    }, {

    field: "ttinfo2",

    title: " "

    }]

    })

    now if you try and find out what the filter is by doing this...

    var filter123 = $('.other-details').data('kendoGrid').dataSource.filter();

    console.log("1st: " + filter123.logic);  

    console.log("2nd: " + filter123.filters[0]);

    i get the following:

    1st: and

    2nd: [object Object]

    Can you please advise me on what is going wrong here?

  • Hi

    If i look at the json of the deployed war file for the version in 11.3 it looks like this for read of this business entity:

    {

                           "path": "?filter={filter}",

                           "type": "read",

                           "verb": "get",

                           "params": []

                       },

    {

    if i look at the json of the deployed war file for the version in 11.7 it looks like this for read of this business entity:

    "path": "?filter={filter}",

                           "useBeforeImage": false,

                           "type": "read",

                           "verb": "get",

                           "params": [

                               {

                                   "name": "filter",

                                   "type": "QUERY"

                               },

                               {

                                   "name": "dsTransaction",

                                   "type": "RESPONSE_BODY"

                               }

                           ]

                       },

    This seems to be the issue because if deploy the 11.3 war file everything works.. however deploying the 11.7 war file is a problem.. as you can see there are differences????

  • Hello,

    Thank you for the additional information.

    In general, the difference that you observed in the catalog file should not impact the filter operation.

    Internally, when using the version in 11.3, the JSDO knows that filter is a parameter because it extracts it from the "path" property. The difference with the new catalog is that it is explicitly defined.

    It would be interesting to see how the query string between the two cases compare.

    What does your filter look like when using 11.3?

    Do you have special code in the Business Entity to process the filter?

    When using serverFiltering, the filter is passed to the backend for processing.

    You should see the same behavior, a filter being passed to the server, with both, 11.3 and 11.4.

    The filter expression from the Kendo UI DataSource is an object with the various conditions.

    To process such an object, we use the JSON Filter Pattern.

    The READ operation in the Business Entity would include the following annotations:

    @openapi.openedge.method.property (name="mappingType", value="JFP").

    @openapi.openedge.method.property (name="capabilities", value="ablFilter,top,skip,id,orderBy").

     METHOD PUBLIC VOID ReadCustomer( ... ):

    See details and sample implementation at:

    documentation.progress.com/.../index.html

    The annotation mappingType = JFP is added to the catalog and in this way, the JSDO on the client side can recognize that this is the method that you intend to use to process a filter expression.

    A built-in mappingType plugin in the JSDO, converts the object with the filter expression into an ABL query expression.

    A serialized JSON object is sent the server.

    The code in the documentation is a sample implementation for the JFP. You can change the code if you need it. The key is that it should keep the protocol (interface) the same.

    Alternatively, you can write your own code to process a filter expression as an object.

    Please let me know what you find from looking at the query string.

    I hope this helps.