Go Back   SmartClient Forums > Smart GWT Technical Q&A
Wiki Register Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 7th May 2012, 04:20
corne corne is offline
Registered Developer
 
Join Date: Mar 2012
Posts: 1
Default DynamicForm and mulitple ListGrids on single nested DataSource

Hi

We are currently using SmartGWT (SmartClient Version: 8.2/LGPL Development Only in the Developer Console) using Google Chome 18 for debugging.

We're trying to bind a DynamicForm and Listgrid to a complex JSON object that we receive from a C# WCF web service and have run into the following problem:

The structure of the JSON received means that we want to bind Textfield to some higher level properties and use a grid to display some of the lower level items in the nested object.

For e.g. the JSON object looks like this:

{
"TopLevel": {
"Property 1": "",
"Property 2": "",
"Property 3": [
{
"SubProperty 1": "",
"SubProperty 2": ""
},
{
"SubProperty 1": "",
"SubProperty 2": ""
}
]
}
}

We are trying to bind the TextFields in the DynamicForm to the top level Property 1 and 2 and use a grid to display the row items under Property 3.
(Both the ListGrid and the DynamicForm bound to the same DataSource)

The problem we've encountered is that we can only set one RecordXpath which is currently set to TopLevel. The dynamic form binds to these values successfully. But we cannot seem to bind the ListGrid to Property 3 without changing the RecordXPath of the entire data source.
If we do not change the RecordXPath of the datasource both items under property 3 shows as a single record in the ListGrid.

Thanking you in advance

Last edited by corne; 7th May 2012 at 04:25..
Reply With Quote
  #2  
Old 7th May 2012, 09:35
Isomorphic Isomorphic is offline
Administrator
 
Join Date: May 2006
Posts: 37,469
Default

See the FAQ on binding to pre-existing or generated REST services - you probably do not want to use them unless you have no choice. Use RestDataSource instead - there is an extensive tutorial on the best way to do this.

Also, here you would want to represent this data structure as two or more DataSources.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search


© 2010,2011 Isomorphic Software. All Rights Reserved