Announcement

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

    Problems with ComboBoxItem and SpecialValues

    Problem with ComboBoxItem and SpecialValues


    I am experiencing two problems.


    1. When two different comboboxes on seperate forms share the same datasource.. they try and share the same special values even if its only set up on one of the comboboxes.

    2. Setting setDefaultValue() to one of the “special” options works .. but when dropping down the combobox the first non-special value appears highlighted.


    I have demonstrated these in the included test case -


    Try dropping down the first combobox and then the second - the special values render at the very top of the screen.

    When dropping down the second combobox and then the first - the special values appear in the first combobox as well !


    The second combo has a default value set but when dropping it down it is not highlighted/selected in the picklist- the first normal value is instead.



    The file is designed to just overwrite the BuiltInDS.java file in the BuiltInDS sample and work with no other changes.

    Code:
    Code:
    package com.smartgwt.sample.client;
    
    import java.util.LinkedHashMap;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.smartgwt.client.data.DataSource;
    import com.smartgwt.client.widgets.Label;
    import com.smartgwt.client.widgets.form.DynamicForm;
    import com.smartgwt.client.widgets.form.fields.ComboBoxItem;
    import com.smartgwt.client.widgets.layout.HLayout;
    
    public class BuiltInDS implements EntryPoint {
    
    	@Override
    	public void onModuleLoad() {
    
    		DynamicForm form = new DynamicForm();
    		form.setWidth(400);
    
    		ComboBoxItem combo1 = new ComboBoxItem();
    		combo1.setOptionDataSource(DataSource.get("supplyItem"));
    		combo1.setDisplayField("itemName");
    		combo1.setValueField("itemID");
    		combo1.setName("filteredSelect");
    		combo1.setTitle("Choose an item (Select)");
    
    		form.setFields(combo1);
    
    		DynamicForm form2 = new DynamicForm();
    		form2.setWidth(400);
    
    		LinkedHashMap<String, String> hashMap = new LinkedHashMap<String, String>();
    		hashMap.put("**EmptyValue**", "None");
    		hashMap.put("-1", "Not Applicable");
    
    		ComboBoxItem comboBoxItem = new ComboBoxItem();
    		comboBoxItem.setName("filteredCombo");
    		comboBoxItem.setTitle("Choose an item (ComboBox)");
    		comboBoxItem.setAddUnknownValues(false);
    		comboBoxItem.setOptionDataSource(DataSource.get("supplyItem"));
    		comboBoxItem.setDisplayField("itemName");
    		comboBoxItem.setValueField("itemID");
    		comboBoxItem.setSpecialValues(hashMap);
    		comboBoxItem.setSeparateSpecialValues(true);
    		comboBoxItem.setDefaultValue("**EmptyValue**");
    
    		form2.setFields(comboBoxItem);
    
    		HLayout hLayout = new HLayout();
    		hLayout.addMember(new Label(com.smartgwt.client.Version.getSCVersionNumber()));
    		hLayout.addMember(form);
    		hLayout.addMember(form2);
    		hLayout.draw();
    	}
    
    }
    My version is: v10.0p_2014-10-07/Pro Deployment (built 2014-10-07)


    Thank-you very much in advance.

    #2
    Thanks for the notification. We've made a change to address this issue. Please try the next nightly build, dated October 10 or above

    Regards
    Isomorphic Software

    Comment


      #3
      That appears to have fixed the first issue in the 5.1d branch - nothing appears to have changed 5.0p branch though [2014-10-10] ?

      The second issue (The picklist highlighting using setDefaultValue() to one of the special values) still appears to be an issue in both branches ? would some screenshots help explain the problem ?

      Thanks,

      Comment


        #4
        Please retry the latest 5.0p package for the fix for #1 - it should now be present.

        On #2 we understand what you're describing and are taking a look

        Regards
        Isomorphic Software

        Comment


          #5
          Thanks again Isomorphic, the fix for #1 works great. :-)

          Comment


            #6
            I have the same problem with SelectItem. I am using SmartClient Version: v10.1p_2017-06-27/LGPL Development Only (built 2017-06-27). Attached is a sample test case.
            Attached Files

            Comment


              #7
              Any help with this additional issue?

              Comment


                #8
                The issue in the last test case has been corrected in builds available on Jul 25.

                Regards
                Isomorphic Software

                Comment

                Working...
                X