Announcement

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

    SelectOtherItem's picklist fails to show other when configured with an optionDataSource

    I'm have a custom field for a related datasource that I'm attempting to use listGrid.setEditorCustomizer(...) to construct an editor for. I want the functionality of a SelectItem that allows the user to create a non existent value if the pickList does not contain it. A SelectOtherItem configure with an OptionDataSource seems like the logical widget for the job. However, the pickList's other option disappears when configured that way.

    Here is a smartgwt/showcase/#select_other_combobox_category mod that shows the issue:

    Code:
            final DynamicForm form = new DynamicForm();  
            form.setWidth(300);  
    
            SelectOtherItem selectOtherItem = new SelectOtherItem();  
            selectOtherItem.setOtherTitle("Other..");  
            selectOtherItem.setOtherValue("OtherVal");  
            selectOtherItem.setTitle("Units");  
            // configure the values with an optionDataSource instead
            //selectOtherItem.setValueMap("Ea", "Pkt", "Bag", "Ctn");  
            selectOtherItem.setValueField("BenchName");
            selectOtherItem.setOptionDataSource(DataSource.get("Test_Bench"));
    
            form.setFields(selectOtherItem);
    SmartClient Version: v11.1p_2018-07-19/PowerEdition Deployment (built 2018-07-19) using Chrome

    #2
    This is a known and documented limitation, but due to a glitch in some of our tools, the docs aren’t appearing as intended. We’ll fix that, but in the meantime, the selectItem.specialValues feature provides a way to implement something similar to SelectOtherItem, but with a UI more appropriate to optionDataSource (special values can appear *on top*), as well as the ability to add an “other” value that involved a custom form or other UI beyond a simple dialog.

    Comment


      #3
      Thanks, I'll look at that.

      Comment

      Working...
      X