1. SmartClient Version: v9.1p_2014-07-23/Pro Deployment (built 2014-07-23)
2. Build identifier: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0
3. N/A
4. N/A
5. N/A
6. Code follows
Is there a way to add an empty option to a Combo box?
User need:
From a user point of view, the Select Item and the Combo box are the same with the difference that one can be typed in and the other cannot.
The Select Item is clearable via an empty option in the drop down but not the Combo box as the empty option is not available.
This forces the user to clear the combo box by selecting the typed in text and clearing it or backspacing it.
Having a form that contains these two controls side by side results in an inconsistent user experience.
What I tried:
I added the property "allowEmptyValue : true" to the Select Item widget.
Being a select item, an empty option is now available as per the documentation.
Now I require the empty option to be available in a Combo Box. Hence I searched for a way of doing this
and added the 'allowEmptyValue' property to the Combo Box Item in the hope of getting the same behaviour
but it did not do so nor should it as per the documentation for a Combo Box.
Unfortunately, I could find nothing in the documentation that would allow the addition of the empty option in a Combo box.
Note that the Combo box has an optionDataSource specified as all its data comes from the backend.
I also tried inserting a valueMap with empty properties in the hope that the final result would be a mix of data from the
backend and the empty properties. The optionDataSource documentation does indicate that the valueMap would override
mappings if present and (this is conjecture on my part) *possibly* ignore the rest of the unknown mappings.
2. Build identifier: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0
3. N/A
4. N/A
5. N/A
6. Code follows
Is there a way to add an empty option to a Combo box?
User need:
From a user point of view, the Select Item and the Combo box are the same with the difference that one can be typed in and the other cannot.
The Select Item is clearable via an empty option in the drop down but not the Combo box as the empty option is not available.
This forces the user to clear the combo box by selecting the typed in text and clearing it or backspacing it.
Having a form that contains these two controls side by side results in an inconsistent user experience.
What I tried:
I added the property "allowEmptyValue : true" to the Select Item widget.
Being a select item, an empty option is now available as per the documentation.
Now I require the empty option to be available in a Combo Box. Hence I searched for a way of doing this
and added the 'allowEmptyValue' property to the Combo Box Item in the hope of getting the same behaviour
but it did not do so nor should it as per the documentation for a Combo Box.
Unfortunately, I could find nothing in the documentation that would allow the addition of the empty option in a Combo box.
Note that the Combo box has an optionDataSource specified as all its data comes from the backend.
I also tried inserting a valueMap with empty properties in the hope that the final result would be a mix of data from the
backend and the empty properties. The optionDataSource documentation does indicate that the valueMap would override
mappings if present and (this is conjecture on my part) *possibly* ignore the rest of the unknown mappings.
Comment