GWT : : v9.1p_2014-10-20/PowerEdition Deployment (built 2014-10-20)
Firefox : v24.0
I have a ListGrid configured with a SelectItem for an editable Users column. The ListGrid is configured with a ds.xml (accounts.ds.xml) and the SelectItem has its own users.ds.xml. Both ds.xml are configured for specific RPC calls for fetch and update , so we use serverType="generic". I want the Accounts data set returned from the server to contain the UserID, and not the UserName, and have the UserName displayed in the SelectItem of the Users Column, using a join with the users datasource. I am not able to get this to function properly using the includeFrom property in the accounts datasource. I am able to make some progress using two foreignKey columns, but if I swap out the foreignKey attribute with includeFrom, the accounts grid returns 0 rows (even though the server request is unchanged).
If have two issues currently:
1) includeFrom returns 0 rows. Two foreign key columns sort of works but I know that's not the out-of-the-box solution. I don't want to go this route long term if its not the correct approach.
2) Passing criteria for the accounts callback does not flow through to the users callback. How do I pass criteria into the users fetch? Because of the join operation I am trying to accomplish, I never explicitly calling the users fetch, so how do I configure the criteria that gets passed into it?
Thanks!
Firefox : v24.0
I have a ListGrid configured with a SelectItem for an editable Users column. The ListGrid is configured with a ds.xml (accounts.ds.xml) and the SelectItem has its own users.ds.xml. Both ds.xml are configured for specific RPC calls for fetch and update , so we use serverType="generic". I want the Accounts data set returned from the server to contain the UserID, and not the UserName, and have the UserName displayed in the SelectItem of the Users Column, using a join with the users datasource. I am not able to get this to function properly using the includeFrom property in the accounts datasource. I am able to make some progress using two foreignKey columns, but if I swap out the foreignKey attribute with includeFrom, the accounts grid returns 0 rows (even though the server request is unchanged).
If have two issues currently:
1) includeFrom returns 0 rows. Two foreign key columns sort of works but I know that's not the out-of-the-box solution. I don't want to go this route long term if its not the correct approach.
2) Passing criteria for the accounts callback does not flow through to the users callback. How do I pass criteria into the users fetch? Because of the join operation I am trying to accomplish, I never explicitly calling the users fetch, so how do I configure the criteria that gets passed into it?
Code:
<!--users.ds.xml--> <DataSource ID="users" serverType="generic" > <operationBindings> <binding operationType="fetch" serverMethod="fetchAccountUsers"> <serverObject lookupStyle="spring" bean="usersService"/> </binding> </operationBindings> <fields> <field name="AccountUserId" type="sequence" hidden="true" primaryKey="true" /> <field name="AccountUserName" type="text" title="Account User" required="true" /> </fields> </DataSource>
Code:
<!--accounts.ds.xml--> <DataSource ID="accounts" serverType="generic" > <operationBindings> <binding operationType="fetch" serverMethod="fetchAccounts"> <serverObject lookupStyle="spring" bean="accountService"/> </binding> <binding operationType="update" serverMethod="updateAccount"> <serverObject lookupStyle="spring" bean="accountService"/> </binding> </operationBindings> <fields> <field name="AccountID" type="integer" hidden="true" primaryKey="true" /> <field name="AccountName" type="text" /> <field name="AccountUserID" title="User" type="integer" foreignKey="users.AccountUserId" displayField="AccountUserName" canEdit="true" editorType="SelectItem" /> <!-- foreignKey here functions correctly, returns data <field name="AccountUserName" foreignKey="users.AccountUserName" hidden="true" /> --> <!-- includeFrom here does not work, 0 rows returned --> <field name="AccountUserName" includeFrom="users.AccountUserName" hidden="true" /> </fields> </DataSource>
Thanks!
Comment