Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

DataSourceField for JSON attribute containing array of Strings

$
0
0
I have JSON returning:

Code:

"data":[
  {
      "id":50904,
      ...
      "buckets":{
        "b1":[
            "b1Value1".
            "b1Value2".
        ],
        "b2":[
            "b2Value1",
            "b2Value2",
        ],
      }
  },
  ...
]

Code:

DataSourceBinaryField field = new DataSourceBinaryField( "buckets_b1, "b1" );
field.setValueXPath( "buckets/b1" );
field.setCanEdit( true );

is this right? How do I make sure I can edit the sub array with a SelectItem.multiple=true in a listgrid cell?

So far the behavior is that my SelectItem.changed[handler] gets fired, but my ListGrid.cellSaved[handler] does nor ListGrid.editComplete[handler].

In short, I need to edit a multi-select attribute in a record attribute sub-structure and have it trigger to go back to the server for update. (I so hope this is doable and not too tricky)

My Details:

1. the *complete* SmartGWT or SmartClient version from the lower left-hand corner of the Developer Console (see FAQ for how to open Developer Console), for example, \"v8.2p_2012-04-18/PowerEdition Deployment\"

SmartClient Version: v9.0p_2013-11-17/LGPL Development Only (built 2013-11-17)

2. browser(s) and version(s) involved

FF/Mac

3. for a server-side problem, the *complete* logs generated during processing of the failing request (do *not* trim to just the error message)

n/a

4. for any problem processing a server response, the actual response as shown in the RPC tab in the Developer Console

n/a

5. if there is a JavaScript error, the stack trace logged in the Developer Console (see FAQ)

n/a

6. sample code if applicable

see above

Viewing all articles
Browse latest Browse all 4756

Trending Articles