Announcement

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

    optionDatasource in listgrid on Dependent Select

    Hi, we are using Smartclient 6.51 Smallvendor and have following problem:

    We have a Listgrid which have a select field with optiondatasource. Data in the listgrid is loaded on dependent select from another listgrid. The OptionDatasource have a diplayField and an ValueField. On fetch operation the valueField is send to he client via xml. This wrks fine, but the displayValue is not displayed. After start editing the selected row the optiondatasource ist fetching new records and we can select them in the select field. After endEditing data is saved and then the displayValue is shown correct for this row. When we select another item from the depenent listgrid the new data ist loaded, but the optiondatasource needs to load specific data for the new selection (the new data for select Field totally differs from the other selection). Unfortunately this don't work. Perhaps we need to call invalidateCache on optiondatasource to force reload and display the new displayFields.

    This is the select Field:
    Code:
    name: 'sheet',type:'select', title:'sheet', width:100, frozen:true,
                valueField: 'id', displayField: 'sheetname',
    				pickListFields:[{name: 'sheetname'}],
    				filterWithValue: false, autoFetchDisplayMap:true,  fetchMissingValues: true,optionDataSource: mydatasource
    I hope you could help us with this problem.

    Thanks in advance

    #2
    You can call fetchData() on the SelectItem to force new data to be fetched. You can also use an override of getPickListFilterCriteria() to control what criteria are passed to the server to perform the fetch, which may result in clearer code - up to you.

    Comment


      #3
      In 7.0 does getPickListFilterCriteria get used on an initial binding of a form now? In other words, if data is bound into the form with editRecord() with existing combo or select value, will these criteria be used in the fetch so the proper display value can be shown?

      In 6.5.1 this does not occur and the workaround is to let the fetch fail and then call fetchData explicitly which does use the criteria.

      dave

      Comment


        #4
        Hi David,

        Could you clarify what you're seeing - a field in a ListGrid with optionDataSource fetches without criteria because it is attempting to get the entire possible set of values, but this is the intended behavior..

        Comment


          #5
          Oh, sorry. I was referring to a ComboBox item not in the list grid but rather a form. In that case, loading an existing record with editRecord or a fetch does not cause the ComboBox to use the criteria from getPicklistFilterCriteria on the initial load to have the correct display value. I was hoping that issue has been fixed in 7.0 to avoid having to make explicit fetchData calls on the combo's that need additional criteria from other fields.

          Comment


            #6
            Hmm, OK, that's unexpected. Can you show a test case that simply demonstrates that a fetch without criteria occurs? It can error out at that point, ie, no sample datasets required.

            Comment

            Working...
            X