Using SmartGWT 2.3 with RestDataSource
Serverside data is delivered something like this.
I have a DataSourceField declared for "childName"
Form Text Field:
The form on load correctly pulls in whatever value was stored on the server, however when submitting the form via "DSProtocol.POSTXML" it does not put the value back in the xpath location. Is there a way to make this happen?
What is submitted to the server...
Note: the restructuring of the XML doc with "elem" is also another problem (ideas on why that is happening?)
Serverside data is delivered something like this.
Code:
<response> <data> <record> <id>123</id> <name>Name</name> <children> <child> <childId>555</childId> <childName>name</childName> </child> <child> <childId>666</childId> <childName>name</childName> </child> </children> </record> </data> </response>
Code:
DataSourceTextField field = new DataSourceTextField("childName" + childId); field.setValueXPath("children/child/childId[text()='"+ childId +"']/following-sibling::childName");
Code:
TextAreaItem childNameField = new TextAreaItem("childName" + childId);
What is submitted to the server...
Code:
<response> <data> <record> <id>123</id> <name>Name</name> <childName555>Updated Name</childName555> <childName666>Updated Name</childName666> <children> <child> <elem> <childId>555</childId> <childName>name</childName> </elem> <elem> <childId>666</childId> <childName>name</childName> </elem> </child> </children> </record> </data> </response>