Hi Isomorphic,
Is there a way for us to get the behaviour of setAddUnknownValues in the case when the selectItem has a specified optionDataSource?
Thanks
Is there a way for us to get the behaviour of setAddUnknownValues in the case when the selectItem has a specified optionDataSource?
Thanks
void com.smartgwt.client.widgets.form.fields.SelectItem.setAddUnknownValues(Boolean addUnknownValues)
If this item's value is set (via setValue() or similar) to a value which is not present in the com.smartgwt.client.types.ValueMap, should the value be rejected.
If set to false the setValue() call will have no effect if the value is not a valid option.
If set to true the item's value will be updated to the new value, and the value will be added to the set of options displayed in the pick-list until the next call to setValueMap() or setValue().
Exception: If the value is set to null but there is no null entry in the valueMap for this item, setting addUnknownValues to true will not cause a null option to show up at the top of the select item pickList. Whether an empty option is shown in the pickList is governed by allowEmptyValue instead.
Note that this property has no effect if the selectItem has a specified optionDataSource. If setValue() is called on a databound SelectItem and the new value does not match any loaded options, the value will be accepted, but not added to the options displayed in the pickList. Also note that if a displayField exists, a fetch will be performed in an attempt to retrieve a valid display value, as described under FormItem.fetchMissingValues. If specified the FormItem.loadingDisplayValue will be displayed while the fetch is in progress, and then the real value (mapped to a display field value if a matching record was found) will be displayed when the fetch completes.
Note : This is an advanced setting
Parameters:addUnknownValues New addUnknownValues value. Default value is trueSee Also:Dependent Selects Example
If this item's value is set (via setValue() or similar) to a value which is not present in the com.smartgwt.client.types.ValueMap, should the value be rejected.
If set to false the setValue() call will have no effect if the value is not a valid option.
If set to true the item's value will be updated to the new value, and the value will be added to the set of options displayed in the pick-list until the next call to setValueMap() or setValue().
Exception: If the value is set to null but there is no null entry in the valueMap for this item, setting addUnknownValues to true will not cause a null option to show up at the top of the select item pickList. Whether an empty option is shown in the pickList is governed by allowEmptyValue instead.
Note that this property has no effect if the selectItem has a specified optionDataSource. If setValue() is called on a databound SelectItem and the new value does not match any loaded options, the value will be accepted, but not added to the options displayed in the pickList. Also note that if a displayField exists, a fetch will be performed in an attempt to retrieve a valid display value, as described under FormItem.fetchMissingValues. If specified the FormItem.loadingDisplayValue will be displayed while the fetch is in progress, and then the real value (mapped to a display field value if a matching record was found) will be displayed when the fetch completes.
Note : This is an advanced setting
Parameters:addUnknownValues New addUnknownValues value. Default value is trueSee Also:Dependent Selects Example
Comment