Announcement

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

    SMART GWT (12.1-p20200813)

    While upgrading SMARTGWT with 12.1-p20200813, I was getting below
    Exception :- [ERROR] 2020-09-23 18:25:26.635 [http-nio-8080-exec-4] TrackerServiceController - Uncaught throwable on the client. Message: "(TypeError) : Cannot read property 'a' of null".

    Cause:- Something changed in the latest GWT on receiving data from the server.
    The server sends an entity data that includes some numbers (ex: childTypes:8642, deleteMask:0), but when client code processes that, those properties are null.
    After I've added a temporary workaround to check for null and treat them as 0, the Uman stopped throwing that error.
    The data from the server has nonnull values, so it's a client problem.

    Please provide me solution .



    #2
    During initialization of the Uman screen, the client pulls data for enitities from the server. These requests return data that looks like this:


    { "affectedRows":0, "data":[ { "licenseCode":"[SBS]", "type":"Corporate", "childTypes":8642, "createMask":16, "managedById":"D2E26A34-0ABB-4097-B157-47B9733CA86A", "id":"D2E26A34-0ABB-4097-B157-47B9733CA86A", "deleteMask":0, "licensableId":"714EB0F4-6957-4BAA-AE0A-9B522C504886", "creatorRank":null, "label":"SBS", "parentId":null, "editMask":0, "assetOwnerId":null, "viewMask":0 } ], "endRow":0, "invalidateCache":false, "isDSResponse":true, "operationType":"fetch", "startRow":0, "status":0, "totalRows":1 }

    and

    { "affectedRows":0, "data":[ { "country":null, "licenseCode":null, "type":"Dealerships", "childTypes":18, "createMask":0, "acctNo":null, "contact":" ", "managedById":null, "oemId":null, "id":"8696E65F-D2E4-42CC-985B-3C31909B545F", "deleteMask":0, "priceMode":null, "city":null, contactPhone1:null, "licensableId":null, "creatorRank":0, address1:null, "label":"DEALERSHIPS", "parentId":"D2E26A34-0ABB-4097-B157-47B9733CA86A", "editMask":0, "assetOwnerId":null, "viewMask":0, "regionId":null, "regionLabel":null }, { "country":null, "licenseCode":null, "type":"Group", "childTypes":8206, "createMask":0, "acctNo":null, "contact":" ", "managedById":null, "oemId":null, "id":"1F1C7C6B-507C-4948-840E-3EB684D8088A", "deleteMask":0, "priceMode":null, "city":null, contactPhone1:null, "licensableId":null, "creatorRank":0, address1:null, "label":"Isuzu Group", "parentId":"D2E26A34-0ABB-4097-B157-47B9733CA86A", "editMask":0, "assetOwnerId":null, "viewMask":0, "regionId":null, "regionLabel":null }, { "country":null, "licenseCode":null, "type":"OEMs", "childTypes":34, "createMask":0, "acctNo":null, "contact":" ", "managedById":null, "oemId":null, "id":"DECC5425-3B72-4974-A91A-D260356896B7", "deleteMask":0, "priceMode":null, "city":null, contactPhone1:null, "licensableId":null, "creatorRank":0, address1:null, "label":"OEMs", "parentId":"D2E26A34-0ABB-4097-B157-47B9733CA86A", "editMask":0, "assetOwnerId":null, "viewMask":0, "regionId":null, "regionLabel":null } ], "endRow":2, "invalidateCache":false, "isDSResponse":true, "operationType":"fetch", "searchResultSetSize":20, "startRow":0, "status":0, "totalRows":3 }

    The client code, while parsing it, attempt to extract the parent entity from the tree:
    private UiEntity getParentEntity( UiEntity child )
    {
    Tree tree = treeGrid.getTree(); TreeNode parentNode = tree.findById( domainEntity.getParentId() );
    UiEntity parentEntity = null;
    if ( parentNode != null )
    {
    parentEntity = createUiEntityFromTreeNode( parentNode );
    }
    return parentEntity;
    }


    In the latest version of SmartGWT, the findById API (https://www.smartclient.com/smartgwt...a.lang.String- ), apparently, does not handle NULL parameter the same way as earlier versions.
    In the 1st JSON, the parent ID is NULL. I assume that findById used to return NULL so that next IF check would skip calling createUiEntityFromTreeNode method.
    In the latest version, call to findById with NULL parameter actually returns a TreeNode, but all attributes are null. The createUiEntityFromTreeNode method does not check for NULL attributes and attempts to assign NULL values to integer fields. This causes an exception to get thrown and results in client stopping processing the data and displaying the UT03 error.
    Last edited by VikasGupta1993; 23 Sep 2020, 05:20.

    Comment


      #3
      We're not seeing the behavior you describe. For us, when null is passed in, null is returned. Can you modify one of our Showcase samples to reproduce the problem, or provide us with running, standalone repro code?

      Comment


        #4
        SmartClient_v121p_2020-08-16_Pro\SmartClient_v121p_2020-08-16_Pro\smartclientRuntime\isomorphic\skins\Enterprise\load_skin

        How can I load the load_skin.js file of new smartgwt version 12.1 in our project??

        Comment


          #5
          SmartClient_v121p_2020-08-16_Pro\SmartClient_v121p_2020-08-16_Pro\smartclientRuntime\isomorphic\skins\Tahoe

          I can able to load the load_skin.js file of new smartgwt version 12.1 in our project but not the enterprise load_skin.js file

          Do I need to add any GWT dependency for it?

          Comment


            #6
            Take a look at the BuiltInDS sample project file BuiltInDS.gwt.xml in the download package. To ensure the skin files are available to be loaded, just inherit the resources:
            Code:
             <inherits name="com.smartclient.theme.enterprise.EnterpriseResources"/>
            To do that but also load the skin,:
            Code:
              <inherits name="com.smartclient.theme.enterprise.Enterprise"/>

            Comment

            Working...
            X