Hi,
I have a UI consisting of hierarchical data read from a Rest datasource. The datasource structure is typically like this:
<A>
<name>xx</name>
<B>
<name>yy</name>
<C>
<number>10</number>
<D>
<description>blabla</description>
</D>
</C>
</B>
</A>
A has multiple B elements.
B has multiple C elements.
C has multiple D elements
I have a grid, gridA, that displays all A names. This grid has a RestDatasource that works fine.
When I click on one row in gridA, I want to display the name of the selected B in a form, formB. This works fine; when a row in A is selected, I call formB.editRecord(record);
Below the name in formB I want to have a grid, gridCD with the following columns:
C.number D.description.
This is where I run into problems. Currently, what I do is to call gridCD.setData(record.getAttributeAsRecordArray(“C”)) when a row is selected in gridA.
GridCD has a client only datasource with two fields, number and description. The number is displayed correctly, but not the description. I need to tell the datasource that the value for the description field is.
I have tried with setValueXPath(“D/description”) but that does not help. I also tried to use a FieldValueExtractor for the description field, but the extractor is not called at all, probably since this is a client only datasource.
So, my question is, how can I make the datasource for gridCD understand where to find the value for the description field.
I have verified that all data is there, I only need to make the datasource understand where to find the description field.
Puh! ![]()
Any ideas?
Thanks
Rolf