Announcement

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

    displayValueFromRecord(true) but still loading all records from optionDataSource

    SmartClient Version: SNAPSHOT_v8.3d_2012-08-04/PowerEdition Deployment (built 2012-08-04)

    I've noticed a change after installing the latest nightly 3.1d build. Many of our tables have a very large number of records and the standard optionDataSource logic doesn't work well when these tables are used as the optionDataSource for a field included in a ListGrid. We've used the recommended method of doing a join on the server side SQL to retrieve the "displayValue" and include it as a separate field in the datasource, then set the following attributes on the ListGridField.

    displayValueFromRecord(true)
    displayField("the display field name provided by the join")
    autoFetchDisplayMap(false)

    This avoids the lengthy fetch and build of the DisplayMap and was working until installing this latest build. After installing it takes a few minutes to display the empty ListGrid. By examining the log, I can see that a full fetch of all records from the optionDataSource is happening again.

    #2
    The advice is actually to not set the optionDataSource on the field at all (only on the editorType). Also just to make sure you're aware of it, for these kinds of simple joins to obtain display values, dataSourceField.includeFrom now avoids the need to do any SQL customization.

    Finally however, can you show how we can reproduce this? It doesn't seem to be happening by just applying your settings to the grid fields in the builtinds sample project.

    Comment


      #3
      Sorry. I discovered the source of the fetch to load all records and it wasn't the optionDataSource loading for the ListGrid after all.

      Comment

      Working...
      X