Announcement

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

    about omitNullMapValuesInResponse

    SmartClient Version 8.0

    in DMI#fetch
    just return dsResponse.data = List<Map<String, Object>>

    that map contain key/value pair with null values

    I just try to set omitNullMapValuesInResponse=true, or omitNullMapValuesInResponse=false, but that entry with null value in that map can not pass to client

    I would like the response showing as below, but how can I do it ?


    //isc_RPCResponseStart-->[
    {
    queueStatus:0,
    isDSResponse:true,
    invalidateCache:false,
    status:0,
    data:[
    {
    status:"Y",
    port:null, <-----this entry can NOT show ????

    .....
    Last edited by xml-leo; 2 Jun 2011, 23:37. Reason: updated

    #2
    Hi Isomorphic, any responses for this issue

    Comment


      #3
      Any workaround???

      Comment


        #4
        SmartClient Version: v11.1p_2018-10-24/AllModules Development Only (built 2018-10-24)

        Chrome on OSX

        Hello Isomorphic, I was just trying the omitNullMapValuesInResponse attribute, but id doesn't seem to work.

        Please try this test case in the #fetchOperationFS sample:

        Code:
        isc.ListGrid.create({
            ID:"dsListGrid", 
            width: "100%",
            height: "100%",
            dataSource: "supplyItem" 
        }).fetchData(null, null, {omitNullMapValuesInResponse: true});
        the response doesn't contain null values.

        Comment


          #5
          Omitting (which means leaving them out) null values is exactly what your code is saying to do.

          Comment


            #6
            oh, sorry for being dumb :-(

            I meant to post a test case with omitNullMapValuesInResponse:false, as:
            Code:
            isc.ListGrid.create({
                ID:"dsListGrid",
                width: "100%",
                height: "100%",
                dataSource: "supplyItem"
            }).fetchData(null, null, {omitNullMapValuesInResponse: false});
            where the response still doesn't contain null values.

            Comment


              #7
              If this is the supplyItem from the Showcase, the data is not provided as Maps. It's from SQL, and we don't retrieve nulls from SQL.

              Comment


                #8
                thanks, I didn't think it wasn't a valid setting for SQLDataSources.

                Comment


                  #9
                  It's a valid setting for any DataSource. However, for SQLDataSources, the Maps that are retrieved from SQL already lack nulls. If you had a custom response with your own Maps and they had nulls, they would be preserved.

                  Comment

                  Working...
                  X