I have a datasource, that includes a reference to another row in the same table. I've got the select working ok, but I haven't been able to find a concrete example of how to setup and operationBinding for updates and deletes that helps me out in this scenario.
The TRANSTO field should be text, not a SelectItem or ComboBoxItem, which is why I didn't set it to the displayField for the TRANS_ID field, and why it's set to hidden, with canHide set to false (this should prevent the column from being made visible right?). There's lots of possible combinations, and I don't want to use a picklist. So, on add or update, I need to take the text entered in the TRANSTO field to look up the TRANS_ID, and use that value, based on the composite key (PREFIX + CODE) contained in the TRANSTO.
Can somebody help me out with this, or point me to relevant documentation and/or code samples?
Code:
<DataSource schema="dbo" dbName="SQLServer" tableName="L_DATA" ID="L_DATA" dataSourceVersion="1" serverType="sql" autoDeriveSchema="true" > <fields> <field sqlType="integer" primaryKey="true" sqlLength="10" name="DATA_ID" type="sequence" hidden="true"></field> <field sqlType="char" sqlLength="1" name="ASP" length="1" type="text" title="PREFIX" width="48"></field> <field sqlType="varchar" sqlLength="7" name="CODE" length="7" type="text" title="CODE" width="96"></field> <field sqlType="varchar" sqlLength="80" name="TITLE" length="80" type="text" width="288"></field> <field sqlType="varchar" sqlLength="20" name="SHORT_TITLE" length="20" type="text" width="120"></field> <field sqlType="integer" sqlLength="10" name="TRANS_ID" type="integer" hidden="true" canHide="false"></field> <field sqlType="varchar" sqlLength="7" name="TRANSTO" customSelectExpression="L_DATA_TRANS.PREFIX + L_DATA_TRANS.CODE" title="Transfer To" width="120"></field> </fields> <operationBindings> <operationBinding operationType="fetch"> <tableClause> L_DATA LEFT OUTER JOIN L_DATA AS L_DATA_TRANS ON L_DATA.TRANS_ID = L_DATA_TRA S.DATA_ID </tableClause> </operationBinding> </operationBindings> </DataSource>
Can somebody help me out with this, or point me to relevant documentation and/or code samples?
Comment