I have a custom picker that does a name-based search on foreign key fields. The foreign key field has a displayField associated with it in the datasource definition. So for example the following Experiment datasource has foreign key to Reference. The Reference field has a custom picker called "objectFinder".
When I use the custom picker in a filterEditor, the item 'referenceName' is being handed to the fetchData() operation instead of reference. On the server, the log shows the filter criteria as {referenceName: "REF123"}.
The primary key value for the reference is correct but the field name is not.
When I execute getValues() on the ListGrid filterEditor in the console I get this:
Evaluator: result of 'isc_ListGrid_66.filterEditor.getValues()' (32ms):
{project: undef,
reference: "REF.33713",
externalId: undef,
referenceName: "REF.33713"}
Here is the code that sets the selection on the custom picker:
When I Log.logInfo() the values for the valueMap and setValue(), all is correct.
Any thoughts as to why "referenceName" field is being handed to the fetch operation instead of "reference".
Thanks,
-pf
Code:
<DataSource ID="ExperimentDS" serverType="generic" > <fields> <field name="id" title="id" type="text" isIdentity="false" length="36" hidden="true" primaryKey="true" /> <field name="reference" title="reference" type="text" valueType="custom" editorType="objectFinder" requiresServer="true" displayField="referenceName" /> <field name="referenceName" title="reference name" type="text" hidden="true" /> <field name="externalId" title="external id" type="text" isIdentity="false" length="64" /> <field name="description" title="description" type="text" isIdentity="false" length="512" /> </fields> </DataSource>
The primary key value for the reference is correct but the field name is not.
When I execute getValues() on the ListGrid filterEditor in the console I get this:
Evaluator: result of 'isc_ListGrid_66.filterEditor.getValues()' (32ms):
{project: undef,
reference: "REF.33713",
externalId: undef,
referenceName: "REF.33713"}
Here is the code that sets the selection on the custom picker:
Code:
// set the specified value and dismiss the picker dialog setSelection : function (record) { var valueMap = {}; var value = record.value; valueMap[record.id] = value; this.setValueMap(valueMap); this.setValue(record.id); this.list.setData([]); this.dialog.hide(); }
Any thoughts as to why "referenceName" field is being handed to the fetch operation instead of "reference".
Thanks,
-pf
Comment