Announcement

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

    What should the server send for null value on client side integration?

    SmartGwt 3.0

    I have a client side integration using the RestDataSource where integer (and other) fields might be null in the response xml.

    I've worked around it by just not including null fields in the response xml.
    I've tried just using the empty string ("") to have the server send: <fieldName></fieldName>.
    When this gets to the client side NOT_NULL criterion is no longer valid.
    (Which is stated in the OperatorId doc: value is non-null. Note empty string ("") is non-null )

    So my question is what does the client expect in the xml response that would cause it to create a field with null as it's value?

    #2
    If you're looking for Record.getAttribute() to return null, just omitting the tag entirely will do that. For the other direction (explicitly saving a null value) see dataSourceField.nillable.

    Comment


      #3
      Sorry maybe I missed something.

      There doesn't appear to be a DataSourceField method inhereted or otherwise called "nillable".
      I also looked for "nullable" as well as anything with a get/set.

      As I said, I'm basically just not sending the field but I'd just like to know how to handle it if it ever comes up.

      Comment


        #4
        nillable is a relatively recent addition.

        You haven't clarified what you're looking for - Record.getAttribute() to return null, or something more?

        Comment


          #5
          I think the link to nillable may have answered it.

          To clarify my question.
          Basically, yes, I am looking for a getAttribute call to return a null value.

          I was just wondering how the server dealt with it and if there was something other than just not sending the field tags in the response.

          Thank you.

          Comment

          Working...
          X