Hi,
I'm using smartGWT version 2.5 and have following problem with SelectItems (in all browsers).
I have a Person entity with association ManyToOne to Address entity, I'd like to show person in DynamicForm with SelectItem address.
DynamicForm has assigned RestDataSource in json format and address field in that datasource has type of address RestDataSource, both dataSources are connected to server's services. Response of fetching data to form has following format:
Address SelectItem has following properties:
When fetch response arrived, data are set to form and then smartGwt invoke additional request to retrieve missing properties for address - display property, when this response arrives, selectItem is correctly set up with value "Street 1".
When I call saveData() on that form, saving service is call that has exactly the same response like fetching service, but smartGWT tries to fetch missing values for selectItem with these criteria (previously after fetch response it was "id"=1):
and when response arrives with exact the same format like previously after fetching, select item is set up with value "[Object Object]" instead of "Street 1"
It seems for me that dataPath after update is ignored.
Could you please help me where can be problem?
thanks,
michal
I'm using smartGWT version 2.5 and have following problem with SelectItems (in all browsers).
I have a Person entity with association ManyToOne to Address entity, I'd like to show person in DynamicForm with SelectItem address.
DynamicForm has assigned RestDataSource in json format and address field in that datasource has type of address RestDataSource, both dataSources are connected to server's services. Response of fetching data to form has following format:
Code:
{ "response": { "totalRows": 1, "data": [ { "address": { "id": "1", "name": "Street1" }, "birthDate": "2011-08-07", "deceasedDate": "2011-08-08 22:24:12", "id": 1, "maidenName": "Hrasko", "title": "Person 1" } ], "status": 0, "startRow": 0, "endRow": 0 } }
Address SelectItem has following properties:
Code:
address.setOptionDataSource(addressDataSource); address.setDisplayField("name"); address.setValueField("id"); address.setDataPath("address/id");
When I call saveData() on that form, saving service is call that has exactly the same response like fetching service, but smartGWT tries to fetch missing values for selectItem with these criteria (previously after fetch response it was "id"=1):
Code:
"id"={"id"=1, "name"="Street 1}
It seems for me that dataPath after update is ignored.
Could you please help me where can be problem?
thanks,
michal
Comment