Announcement

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

    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; 7 May 2012, 04:25.

    #2
    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.

    Comment

    Working...
    X