Hi,
I'm using the CompoundEditor (grid and form with common datasource) from the ShowCase and now stuck with the rendering when I use a nested datasource. Model is simple, I have userGroups, and all userGroup have a set of permissions.
My datasources returning the following xml-s for fetch:
userGroup:
permissions:
I'm setting the permissionsField's type to the permissions datasource ID, also setting the foreign key and children properties. (cannot set here the editorTYpe until Sanjiv do not fix it, see http://forums.smartclient.com/showthread.php?p=19128)
The problem is, that both the grid and the form is displaying only [object Object]. Since I cannot set the editorType on DataSourceField, I tried to add a ListGridField and a SelectItem to the grid and form, but it does not help. Also tried to use the optionDataSource property on the SelectItem, but still not working.
Can anybody mention a workaround or do I miss anything? I have a worry, that it was left out from ShowCase for reason...
I'm using the CompoundEditor (grid and form with common datasource) from the ShowCase and now stuck with the rendering when I use a nested datasource. Model is simple, I have userGroups, and all userGroup have a set of permissions.
My datasources returning the following xml-s for fetch:
userGroup:
Code:
<response> <status>0</status><startRow>0</startRow><endRow>2</endRow><totalRows>2</totalRows> <data> <record> <id>1</id> <name>user group 1</name> <permissions> <permission>1</permission> <permission>2</permission> </permissions> </record> <record> <id>2</id> <name>user group 2</name> <permissions> <permission>1</permission> <permission>2</permission> </permissions> </record> </data> </response>
Code:
<response> <status>0</status><startRow>0</startRow><endRow>2</endRow><totalRows>2</totalRows> <data> <record> <id>1</id> <name>permission 1</name> </record> <record> <id>2</id> <name>permission 2</name> </record> </data> </response>
Code:
DataSourceField permissionsField = new DataSourceIntegerField( "permissions", "Permission IDs" ); permissionsField.setForeignKey( DS_USER_GROUPS + ".id" ); permissionsField.setChildrenProperty( true ); permissionsField.setType( DataSource.get( DS_PERMISSIONS ) );
Can anybody mention a workaround or do I miss anything? I have a worry, that it was left out from ShowCase for reason...
Comment