Hi Pro-crastinator.
"RPC Response comes back with no data" could mean that the join results in 0 rows, because the pipelineKey is empty. In that case, use joinType="outer" on the field with the foreignKey.
Check the generated SQL in the server side log if it looks like you expect it to look.
Asides of this, this is working for me.
Best regards
Blama
Announcement
Collapse
No announcement yet.
X
-
Please revisit the docs for dataSourceField.includeFrom: it causes dispalyField values to be included with every record, so that you can see it for instance in every grid row, and not just the currently edited grid row (where a fetch can potentially be done just for the current record).
It sounds as though you tried to use the includeFrom attribute, but something went wrong. Revisit that attempt, and this time look at the server-side logs to find out what's happening (this is always the first troubleshooting step for a server-side issue).
Leave a comment:
-
Originally posted by Blama View PostHi Pro-crastinator ,
you are missing your displayField (which you define as displayField="pipeline.name", "." not allowed).
Code:<field name="pipelineKey" ... displayField="pipeline_name" /> <field name="pipeline_name" includeFrom="pipeline.name" />
Best regards
Blama
Thanks for your reply. I should have mentioned that I had tried that approach already, based on what I saw in the DataSourceField docs for includeFrom, but that approach presents a different issue: I can set breakpoints in my IDE and see that data is being returned from the server, but on the client side the grid displays no Contract object data and the developer console shows that the RPC Response comes back with no data.
I guess at this point, my question is: why is it that the correct display values (pipeline.name) only gets displayed when I'm editing the field and not all the time? That tells me that the field is getting the correct data from the pipeline datasource, it's just not always displaying the information correctly.
Leave a comment:
-
Hi Pro-crastinator ,
you are missing your displayField (which you define as displayField="pipeline.name", "." not allowed).
Code:<field name="pipelineKey" ... displayField="pipeline_name" /> <field name="pipeline_name" includeFrom="pipeline.name" />
Best regards
Blama
Leave a comment:
-
ListGrid SelectItem Showing Incorrect Values on ForeignKey Relationship
SmartClient Version: v10.1p_2016-12-11/Enterprise Deployment (built 2016-12-11)
Chrome Version 64.0.3282.167
I have two objects, Contract and Pipeline. Each Contract has an attribute containing an integer key that references a Pipeline.
I have a ListGrid that displays rows of Contract data with a datasource xml defining the fields, and a separate Pipeline datasource xml because I have another grid elsewhere that shows Pipeline information. Both datasource xml files have operation bindings to Java files that interact with an Oracle SQL database. One of the columns of my Contract ListGrid shows the Pipeline key reference, but I want it to show the String name for the referenced Pipeline. After searching the forums and docs, I setup a foreignKey relationship on my Contract datasource field like so:
contract.ds.xml
Code:<DataSource ID="contract" allowAdvancedCriteria="true"> <fields> <field name="contractKey" title="Key" hidden="true" type="integer" primaryKey="true" required="true"/> <field name="name" title="Name (Full)" hidden="false" type="text" canEdit="true" width="10%"/> <field name="abbrev" title="Abbrev" hidden="false" type="text" canEdit="true" width="6%"/> <field name="contractRef" title="Contract Ref" hidden="false" type="text" canEdit="true" width="10%" cellAlign="center"/> <field name="description" title="Description" hidden="false" type="text" canEdit="true" width="10%"/> <field name="pipelineKey" title="Pipeline" hidden="false" type="integer" canEdit="true" width="10%" cellAlign="center" foreignKey="pipeline.pipelineKey" displayField="pipeline.name" valueField="pipelineKey"/> </fields> <operationBindings> <binding operationType="fetch" serverMethod="executeFetch"> <serverObject className="com.my.app.contracts.ContractDS"/> </binding> </operationBindings> </DataSource>
Code:<DataSource ID="pipeline" allowAdvancedCriteria="true"> <fields> <field name="pipelineKey" hidden="true" title="Key" type="integer" primaryKey="true"/> <field name="name" hidden="false" title="Pipeline Name" type="text" width="20%" canEdit="true" required="true"/> <field name="description" hidden="false" title="Description" type="text" width="30%" canEdit="true"/> <field name="pipelineType" hidden="false" title="Type" type="text" width="10%" canEdit="true" required="true"/> </fields> <operationBindings> <binding operationType="fetch" serverMethod="executeFetch"> <serverObject className="com.my.app.pipeline.PipelineDS" /> </binding> </operationBindings> </DataSource>
Code:public class ContractGrid extends ListGrid { public ContractGrid() { super(DataSource.get("contract")); this.setCanEdit(true); this.setDataFetchMode(FetchMode.LOCAL); this.setCriteria(place.getDateCriteria()); this.setWidth(100); this.setHeight(100); this.setDrawAheadRatio(4); this.setCanExpandRecords(true); this.setAutoFetchData(true); } }
Tags: None
Leave a comment: