Announcement

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

    Programmatically set edit value in list grid to null for numeric field

    I need to set edit value in list grid from existing value to null in numeric field. Edits come from external component and must be reflected on the grid. Filed is not required so it can have null value.
    I was trying the following:

    1)
    setEditValue(rowNum, (Integer)null) -- throws an exception

    2)
    HashMap map = new HashMap<>();
    map .put("fieldName", null);
    listGrid.setEditValues(rowNum, map); -- look like this is working the same as clearEditValue(rowNum, "fieldName")

    I'm using SmartGWT 6.0p



    #2
    Your call to setEditValue() is invalid - there's no signature like that.

    We see no problems if we fix that call:

    Code:
    setEditValue(rowNum, fieldName, (Integer)null);
    Last edited by Isomorphic; 4 Dec 2016, 23:06.

    Comment


      #3
      Sorry for mistake in the post. Of course I'm invoking this method with fieldName parameter. Without this parameter I will have compilation error, but I have exception thrown from the framework:

      TypeError: Cannot read property 'intValue_1_g$' of null

      Comment


        #4
        We're not seeing that in our testing - so we'll need a standalone test-case that shows the error.

        Please also try casting your null to (String) rather than (Integer) and let us know if that works.

        Please also note your exact build of SmartGWT, and test against the latest build from smartclient.com/builds if you're not already using the latest.

        Comment


          #5
          Casting null to String resolved the problem. Thanks!

          Comment


            #6
            Great - we'll look at adding an Integer-based overload of setEditValue().

            Comment


              #7
              Note that, as of builds dated December 15, we've added Integer and Boolean overloads of setEditValue() and tweaked the Object variants to deal with null - 6.0 and 6.1 only.

              Comment

              Working...
              X