Announcement

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

    Smartgwt Mobile - getAttributeAsRecord fails as is a String

    Hello,

    We have just started looking at Smartgwt Mobile after a long break. We have applications written using Smartgwt which are working brilliantly and we are very please, thank you!

    We have come across an issue with the mobile client though.

    Smartgwt Mobile downloaded 24/09/2013

    We want to use the existing rest calls for the mobile application but when we try and call record.getAttributeAsRecord on a returned record it fails because the said attribute is stored as a String rather than as a record.

    An example of the JSON the server is generating is below and as I mentioned, it is all fine with smartgwt.
    Code:
    {
        "response":{
            "status":0, 
            "startRow":0, 
            "endRow":0, 
            "totalRows":2, 
            "invalidateCache":false, 
            "errors":[
            ], 
            "data":[
                {
                    "id":8783, 
                    "title":"", 
                    "description":"", 
                    "startDate":"2013-10-08", 
                    "endDate":"2013-10-08", 
                    "calendarId":5, 
                    "style":"#99CCFF", 
                    "venue":"", 
                    "startTime":"1970-01-01T09:00:00", 
                    "endTime":"1970-01-01T09:50:00", 
                    "clientId":277, 
                    "productId":0, 
                    "paymentRef":-1, 
                    "status":"", 
                    "active":true, 
                    "parentId":0, 
                    "parent":true, 
                    "clientName":null, 
                    "client":{
                        "id":277, 
                        "firstName":"This", 
                        "lastName":"Person", 
                        "companyName":"", 
                        ...
    Where the client is the part which we are expecting to be able to access via getAttributeAsRecord.
    Are we missing a setting? Any help would be greatly appreciated.

    Kind Regards,
    Jeni
    Last edited by jrich; 7 Oct 2013, 12:37. Reason: Code tags added - sorry

    #2
    Hello,

    Just wondered if there were any thoughts on this?

    Kind Regards,
    Jeni

    Comment


      #3
      Your nested JSON structure should have ended up as a Record as it did in the desktop version of SmartGWT. This has been fixed for tomorrow's nightly build.

      Note that values *inside* the nested JSON Object will all end up as Strings unless you use DataSourceField.setTypeAsDataSource to provide a DataSource that describes the nested Object, giving a type to each field.

      Comment


        #4
        Thank you,
        Jeni

        Comment

        Working...
        X