Hi,
Using SGWT 2.5
I have a use case where on a page i have a form and a grid. Rather than having multiple data sources for each of these, i have created a single DS and applied to both these widgets. So that i can get the entire page data in one go.
i see 2 issues here,
1. Response construction - I created a response which conforms to the DS standard, i.e.
In the above response format i wanted to include the form data as well. I tried adding it at same level as <data> within a <metadata> tag. In the datasource i used "field.setValueXPath" to identify the location. This helped me get the data in the form but it did not load the grid. So i put the <metadata> tag inside the 1st <record> element and both the form and grid got loaded with data.
However i am not so sure about the XML format i created(i.e. does not look right, feels more of a work around). Any better solutions around creating a format that will help load both the form and grid via a single DS.
2. Secondly both Form and Grid make separate server calls, which is just redundant. Can i make a single server call and yet have both the widgets loaded via DS.
I have set the following 2 properties for both form and grid,
Any solutions around getting this done more efficiently.
Using SGWT 2.5
I have a use case where on a page i have a form and a grid. Rather than having multiple data sources for each of these, i have created a single DS and applied to both these widgets. So that i can get the entire page data in one go.
i see 2 issues here,
1. Response construction - I created a response which conforms to the DS standard, i.e.
Code:
<response> <status>0</status> <startRow>0</startRow> <endRow>2</endRow> <totalRows>2</totalRows> <data> <record> <field1></field1> <field2></field2> </record> <record> <field1></field1> <field2></field2> </record> </data> </response>
However i am not so sure about the XML format i created(i.e. does not look right, feels more of a work around). Any better solutions around creating a format that will help load both the form and grid via a single DS.
2. Secondly both Form and Grid make separate server calls, which is just redundant. Can i make a single server call and yet have both the widgets loaded via DS.
I have set the following 2 properties for both form and grid,
Code:
.setDataSource(ds); .setAutoFetchData(true);
Comment