Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    includeFrom results in optionDataSource.displayField is not being set

    Hello,

    It appears that optionDataSource.displayField is not being set based on the information provided in the datasource.ds.xml as mentioned in Editing included fields here http://www.smartclient.com/smartgwte...ml#includeFrom
    The issue can be observed by modifying money_transfer.ds.xml as following
    Code:
    <field name="paymentCurrencyId" foreignKey="currency.id" relatedTableAlias="payment" displayField="paymentCurrencySymbol"/>
    <field name="paymentCurrencySymbol" includeFrom="currency.symbol" includeVia="paymentCurrencyId" hidden="true"/>
    and adding it to builtinDS example:
    Code:
    grid.setData(new ListGridRecord[]{
           new DSRecord("moneyTransfer", moneyTransfer")});
    Payment Currency ID becomes SelectItem with optionDataSource correctly set to currency, but the SelectItem shows empty rows, one for every record in currency datasource. Selecting a row and moving out of the SelectItem shows currency.id as the field value, not currency.symbol as expected. Is there an extra configuration that needs to be done in order to assign displayField correctly?

    The issue has been identified using Isomorphic SmartClient/SmartGWT Framework (v9.1p_2014-06-22/Enterprise Deployment 2014-06-22) and FireFox 24.6.0
    Attached Files

    #2
    What's happening is that a fetch against the "currency" DataSource does not return a field named paymentCurrencySymbol so the displayField setting is incorrect.

    To fix this, you'd add a "paymentCurrencySymbol" field to the "currency" DataSource and use includeFrom to pull data from the currencySymbol DataSource.

    It looks like you were expecting this to somehow automatically happen, probably because when includeVia is *not* used, the configured displayField may happen to have the same name in the local record and the related record from the optionDataSource, and so in that simpler case there is no need for any further setting or additional field.

    Comment

    Working...
    X