Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Criteria missing from one DSRequest but not the next?

    I'm passing the same criteria object to the fetchData() method of two different list grids. The datasources for both grids have the same field name which is the field used in the criteria. I've echoed the criteria to the console just before the two calls to fetchData() and can see that it contains the correct value. When I look at the dev console I see both DSRequests going to the server, but the first one doesn't have any criteria and the second one does. Here is the code.
    Code:
    Map extras = new HashMap();
    extras.put("GroupLevel", groupLevelSelect.getValue());
    extras.put("FileGroupSuffix", theFileGroupSuffix);
    DSRequest itemReq = new DSRequest();
    itemReq.setParams(extras);
    DSRequest componentReq = new DSRequest();
    componentReq.setParams(extras);
    SC.logEcho(theCriteria.getJsObj());
    poItemGrid.fetchData(theCriteria, null, itemReq);
    poComponentGrid.fetchData(theCriteria, null, componentReq);
    The log echo shows the criteria ...
    Code:
    23:07:07.977:MUP7:WARN:Log:{IONO: "0000000104"}
    Here is the first of the two DSRequests from the first fetchData() where the criteria is null.
    Code:
    {
        "actionURL":"http://127.0.0.1:8888/ipgui/sc/IDACall", 
        "showPrompt":true, 
        "prompt":"Finding Records that match your criteria...", 
        "transport":"xmlHttpRequest", 
        "promptStyle":"dialog", 
        "params":{
            "GroupLevel":"style", 
            "FileGroupSuffix":""
        }, 
        "bypassCache":true, 
        "data":{
            "criteria":null, 
            "operationConfig":{
                "dataSource":"PoItem", 
                "repo":null, 
                "operationType":"fetch", 
                "textMatchStyle":"exact"
            }, 
            "componentId":"isc_IpListGrid_0", 
            "appID":"builtinApplication", 
            "operation":"PoItem_fetch", 
            "oldValues":null
        }
    }
    And here is the second one, the very next line of code, and the criteria appears as expected.
    Code:
    {
        "actionURL":"http://127.0.0.1:8888/ipgui/sc/IDACall", 
        "showPrompt":true, 
        "prompt":"Finding Records that match your criteria...", 
        "transport":"xmlHttpRequest", 
        "promptStyle":"dialog", 
        "params":{
            "GroupLevel":"style", 
            "FileGroupSuffix":""
        }, 
        "bypassCache":true, 
        "data":{
            "criteria":{
                "IONO":"0000000104"
            }, 
            "operationConfig":{
                "dataSource":"PoComponent", 
                "repo":null, 
                "operationType":"fetch", 
                "textMatchStyle":"exact"
            }, 
            "startRow":0, 
            "endRow":75, 
            "componentId":"isc_IpListGrid_1", 
            "appID":"builtinApplication", 
            "operation":"PoComponent_fetch", 
            "oldValues":{
                "IONO":"0000000104"
            }
        }
    }
    What would cause the criteria to be missing from the first DSRequest?

    #2
    A client-only DataSource or a grid with dataFetchMode:"local" will not send criteria to the server, load the whole dataset, and apply criteria locally.

    If that's not it, try not sharing the actual Criteria object - factor a method that returns it instead, and give each grid a separate copy.

    Comment


      #3
      That was it, thanks. What I really wanted was dataFetchMode:"basic", not "local".

      Comment

      Working...
      X