Announcement

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

    Listgrid Date Filter Advancedcriteria bug?

    Hi, I am testing SmartClient_v83p_2012-12-17 against a REST server.

    Been comparing Smartclient 8.3 against 8.2.

    In 8.3 and a listgrid with dateItem using a filter, SmartClient sends a REST request with an AdvancedCriteria as filter definition. I have noticed that following issues occurs:

    a) first time I set start and end date filters, only that initialCriteria is sent.
    b) second time I update the filter, only the stop date is sent, even the initialCriteria is omitted? The listgrid displays all posts, even those how should not be displayed with a date before the startdate?
    c) The start and stop dialouge uses English texts, where other functionality showing set local language.
    d) Can I override listgrid filter funcionality so the user can input a single date in textform to perform filtering (i.e. same as version 8.2)?

    /Johan

    #2
    Use the instructions in this thread to add translations if they are missing for a given language pack.

    About the criteria issues, can you provide code and instructions to allow this issue to be reproduced?

    Comment


      #3
      Using SmartClient Version: v8.3p_2012-12-17/Pro Deployment (built 2012-12-17)
      I think I have read that AdvancedCriteria Server only works with some versions of Smartclient, can that be an Issue with REST Request as well? Shouldn't be as AdvancedCriteria is used by default when filtering on Date, since version 8.3?

      Conclusion: seems like the Request in Console:RPC shows the expected and complete criteria, but when it arrives to response.php only one critera remains.

      Test steps:
      1) Show the list
      2) Click the date filter field, enter Today and Tommorrow as Criteria press OK
      3) Click the date filter field, just press OK

      Code:
      			isc.RestDataSource.create({
      			    ID:"sp__Login",
      			    fields:[
      			        {name:"Login", title:"Nummer", type:"integer", align: "center", primaryKey:true, canEdit:false},
      			        {name:"UserID", type:"integer", title:"UID"},
      			        {name:"FullName", type:"text", title:"Användare"},
      			        {name:"MWCompanyID", type:"integer", title:"MWID"},
      			        {name:"MWCompanyName", type:"text", title:"Bolagsnamn"},
      			        {name:"LoginType", type:"integer", title:"Typ"},
      			        {name:"SystemUser", type:"integer", title:"Anvtyp"},
      						  {name:"TimeDT", title:"Datum", type:"dateTime", align:"center", displayFormat:"toJapanShortDateTime"}
      			    ],			    
      			    fetchDataURL:"response.php",
      			    addDataURL:"response.php",
      			    updateDataURL:"response.php",
      			    removeDataURL:"response.php"
        		});
        		
      			isc.ListGrid.create({
      			    ID: "LoginList",
      			    width:"100%", height:"100%",
      			    alternateRecordStyles:true,
      			    emptyCellValue: "--",
      			    dataSource: sp__Login,
      			    canEdit:false,
      			    booleanTrueImage: "actions/ok.png",
      			    booleanFalseImage: "actions/nok.png",
      			    checkboxFieldTrueImage: "actions/ok.png",
      			    fields:[
      		        {name:"Login", width:80},
      		        {name:"FullName", width:150},
      		        {name:"MWCompanyName", width:150},
      		        {name:"LoginType", valueMap:{1:"Login", 2:"Reg."}, width:60, align:"center", useTextField:true},
      					  {name:"TimeDT", width:150}
      			    ],
      			    initialCriteria: {SystemUser:0},
         		    sortField: "TimeDT",	
         		    sortDirection: "descending",
      			    dataPageSize: 30,
      			    autoFetchData:true,
      			    showFilterEditor: true,
      			    filterOnKeypress: true,
      			    fetchDelay: 500
      			});
      From response.php I am logging all requests as:

      *************************
      if(isset($_GET['_operationType'])) {
      $Params = $_GET;
      } else {
      $Params = $_POST;
      }

      $tempstr = ""; // 5 lines of testing
      foreach ($Params as $key => $value) {
      $tempstr = $tempstr." ($key: $value)";
      }

      error_log(date("Y-m-d H:i:s")." $tempstr\n", 3, "resp.txt");
      *************************

      Below you can see my logresults above each log from Dev Console:

      10:05:33.238:INFO:Log:initialized
      10:05:34.214:TMR0[E]:WARN:PickListMenu:isc_PickListMenu_0:fields and completeFields are null and there is no DataSource
      10:05:34.410:INFO:Log:isc.Page is loaded
      10:05:57.247:MUP1:WARN:StaticTextItem:isc_StaticTextItem_14[iconPlaceholder]:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
      10:05:57.269:MUP1:WARN:StaticTextItem:isc_StaticTextItem_15[iconPlaceholder]:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
      10:05:57.483:TMR4:WARN:StaticTextItem:isc_StaticTextItem_14[iconPlaceholder]:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
      10:05:57.506:TMR4:WARN:StaticTextItem:isc_StaticTextItem_15[iconPlaceholder]:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element

      // The WARN arrives when I click in the date filterfield and the date filter dialoge opens ...


      1) ***********************************************
      // resp.txt: 2012-12-18 10:05:43 (SystemUser: 0) (_operationType: fetch) (_startRow: 0) (_endRow: 57) (_sortBy: -TimeDT) (_textMatchStyle: substring) (_componentId: LoginList) (_dataSource: sp__Login) (isc_metaDataPrefix: _) (isc_dataFormat: xml)
      {
      "actionURL":"response.php",
      "showPrompt":true,
      "prompt":"Finding records that match your criteria...",
      "transport":"xmlHttpRequest",
      "useSimpleHttp":true,
      "promptStyle":"cursor",
      "params":{
      "SystemUser":0,
      "_operationType":"fetch",
      "_startRow":0,
      "_endRow":57,
      "_sortBy":[
      "-TimeDT"
      ],
      "_textMatchStyle":"substring",
      "_componentId":"LoginList",
      "_dataSource":"sp__Login",
      "isc_metaDataPrefix":"_",
      "isc_dataFormat":"xml"
      },
      "httpMethod":"GET",
      "bypassCache":true,
      "data":null
      }

      2) ***********************************************
      // resp.txt: 2012-12-18 10:06:35 (operator: and) (_constructor: AdvancedCriteria) (criteria: {"operator":"equals","fieldName":"SystemUser","value":0}) (_operationType: fetch) (_startRow: 0) (_endRow: 51) (_sortBy: -TimeDT) (_textMatchStyle: substring) (_componentId: LoginList) (_dataSource: sp__Login) (isc_metaDataPrefix: _) (isc_dataFormat: xml)
      {
      "actionURL":"response.php",
      "showPrompt":false,
      "prompt":"Finding records that match your criteria...",
      "transport":"xmlHttpRequest",
      "useSimpleHttp":true,
      "promptStyle":"cursor",
      "params":{
      "operator":"and",
      "_constructor":"AdvancedCriteria",
      "criteria":[
      {
      "fieldName":"TimeDT",
      "operator":"greaterOrEqual",
      "value":"2012-12-18T00:00:00"
      },
      {
      "fieldName":"TimeDT",
      "operator":"lessOrEqual",
      "value":"2012-12-19T23:59:59"
      },
      {
      "operator":"equals",
      "fieldName":"SystemUser",
      "value":0
      }
      ],
      "_operationType":"fetch",
      "_startRow":0,
      "_endRow":51,
      "_sortBy":[
      "-TimeDT"
      ],
      "_textMatchStyle":"substring",
      "_componentId":"LoginList",
      "_dataSource":"sp__Login",
      "isc_metaDataPrefix":"_",
      "isc_dataFormat":"xml"
      },
      "httpMethod":"GET",
      "bypassCache":true,
      "data":null
      }

      3) ***********************************************
      // resp.txt: 2012-12-18 10:06:45 (operator: and) (_constructor: AdvancedCriteria) (criteria: {"fieldName":"TimeDT","operator":"lessOrEqual","value":"2012-12-19T23:59:59"}) (_operationType: fetch) (_startRow: 0) (_endRow: 51) (_sortBy: -TimeDT) (_textMatchStyle: substring) (_componentId: LoginList) (_dataSource: sp__Login) (isc_metaDataPrefix: _) (isc_dataFormat: xml)
      {
      "actionURL":"response.php",
      "showPrompt":false,
      "prompt":"Finding records that match your criteria...",
      "transport":"xmlHttpRequest",
      "useSimpleHttp":true,
      "promptStyle":"cursor",
      "params":{
      "operator":"and",
      "_constructor":"AdvancedCriteria",
      "criteria":[
      {
      "operator":"equals",
      "fieldName":"SystemUser",
      "value":0
      },
      {
      "fieldName":"TimeDT",
      "operator":"greaterOrEqual",
      "value":"2012-12-18T00:00:00"
      },
      {
      "fieldName":"TimeDT",
      "operator":"lessOrEqual",
      "value":"2012-12-19T23:59:59"
      }
      ],
      "_operationType":"fetch",
      "_startRow":0,
      "_endRow":51,
      "_sortBy":[
      "-TimeDT"
      ],
      "_textMatchStyle":"substring",
      "_componentId":"LoginList",
      "_dataSource":"sp__Login",
      "isc_metaDataPrefix":"_",
      "isc_dataFormat":"xml"
      },
      "httpMethod":"GET",
      "bypassCache":true,
      "data":null
      }

      Comment


        #4
        AdvancedCriteria is a nested structure, and can't really be sent as simple URL params. Use a more appropriate setting for RestDataSource.dataProtocol (note you have to set this for the "fetch" operationBinding at least in order to cause criteria serialization as JSON or XML).

        Comment


          #5
          Should also note, the criteria *are* being sent, exactly as you specified: note the "_constructor", "operator" and "criteria" params, where "criteria" is a JSON serialization of the nested subcriteria.

          Comment

          Working...
          X