Announcement

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

    Criterion.getOperatorId() returns string "null" instead of null

    Hi Isomorphic,
    we found an inconsistent behavior with Criterion.getOperatorId() which is part of AdvancedCriteria. After upgrade to smartgwt 5.0 it returns "null" as a string, instead of returning real null.
    We create client side empty advanced criteria like:
    Code:
    AdvancedCriteria ac = new AdvancedCriteria();
    At that moment we have operator as null.
    Then we get this criteria on server side via:

    Code:
    AdvancedCriteria advancedCriteria = dsRequest.getAdvancedCriteria();
    and try to check if the operatorId is null:

    Code:
    advancedCriteria.asCriterion().getOperatorId() == null
    But this condition is after upgrade false, because after transformation from client to server side getOperatorId() returns "null" not null.
    The next condition is true:

    Code:
    advancedCriteria.asCriterion().getOperatorId().equals("null")
    Could you clarify why it was changed?
    Thanks

    We upgraded from smartgwt3 (3.1-p20151015) to smartgwt5 (5.0-p20160129)

    #2
    In a quick test we don't see this effect. Can you share your server-side logs and the contents of the RPC tab in the Developer Console so we can see where this transformation is actually taking place? Please remember these are always required.

    Also, why are you updating to 5.0 instead of 5.1? You should be updating to 5.1 if you are going to spend effort on updating now.

    Comment


      #3
      Updating to 5.1 is planned for later ... this is like it is

      I was able to reproduce it on the ds-dmi sample from the POWER edition.
      First I changed the client site to send empty AdvancedCriteria for the grid fetch:

      Code:
      private void bindComponents(String dsName) {
              DataSource ds = DataSource.get(dsName);
              boundList.setDataSource(ds);
              boundViewer.setDataSource(ds);
              boundForm.setDataSource(ds);
      
              AdvancedCriteria advancedCriteria = new AdvancedCriteria();
              boundList.fetchData(advancedCriteria);
      
              newBtn.enable();
              saveBtn.disable();
          }
      Then I overrode IDACall to be able to set breakpoint and inspect the return value of operator:

      Code:
      public class IDACall extends com.isomorphic.servlet.IDACall {
      
          @Override
          public DSResponse handleDSRequest(DSRequest dsRequest, RPCManager rpc, RequestContext context) throws Exception {
              final AdvancedCriteria advancedCriteria = dsRequest.getAdvancedCriteria();
              final String operatorId = advancedCriteria.asCriterion().getOperatorId();
              System.out.println("operatorId = " + operatorId);
              return super.handleDSRequest(dsRequest, rpc, context);
          }
      }
      As described above the operatorId is "null".

      This is the RPC Request:

      Code:
      {
          "actionURL":"http://127.0.0.1:8888/builtinds/sc/IDACall",
          "showPrompt":true,
          "prompt":"Finding Records that match your criteria...",
          "transport":"xmlHttpRequest",
          "promptStyle":"cursor",
          "bypassCache":true,
          "data":{
              "criteria":{
                  "_constructor":"AdvancedCriteria"
              },
              "operationConfig":{
                  "dataSource":"animals",
                  "repo":null,
                  "operationType":"fetch",
                  "textMatchStyle":"exact"
              },
              "startRow":0,
              "endRow":75,
              "componentId":"isc_ListGrid_1",
              "appID":"builtinApplication",
              "operation":"animals_fetch",
              "oldValues":{
                  "_constructor":"AdvancedCriteria"
              }
          }
      }

      Comment


        #4
        We've made a change to address this issue. Please try the next nightly build, dated February 03.

        Regards
        Isomorphic Software

        Comment

        Working...
        X