Announcement

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

    Warning displayed with Multiple-SelectItem and setDefaultToFirstOption(true)

    Hi Isomorphic,

    please see this BuiltInDS-based testcase (using v10.1p_2016-06-03) where a multiple-SelectItem defaults to the 1st option. This results in a warning that should not be there.

    Code:
    12:17:19.790:MUP8:WARN:SelectItem:isc_SelectItem_5[GenderHC]:compareValues - this is a multiple FormItem but compareValues was called with a non-null first argument `value1` that is not an array.
    12:17:19.792:MUP8:WARN:SelectItem:isc_SelectItem_5[GenderHC]:compareValues - this is a multiple FormItem but compareValues was called with a non-null second argument `value2` that is not an array.
    I assume that the warning itself is correct and triggered by the framework using sth like setValue(1stValue) instead of setValue([1stValue]) internally.

    BuiltInDS.java
    Code:
    package com.smartgwt.sample.client;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.smartgwt.client.Version;
    import com.smartgwt.client.core.KeyIdentifier;
    import com.smartgwt.client.data.DataSource;
    import com.smartgwt.client.util.Page;
    import com.smartgwt.client.util.PageKeyHandler;
    import com.smartgwt.client.util.SC;
    import com.smartgwt.client.widgets.IButton;
    import com.smartgwt.client.widgets.Window;
    import com.smartgwt.client.widgets.events.ClickEvent;
    import com.smartgwt.client.widgets.events.ClickHandler;
    import com.smartgwt.client.widgets.form.DynamicForm;
    import com.smartgwt.client.widgets.form.fields.ButtonItem;
    import com.smartgwt.client.widgets.form.fields.SelectItem;
    import com.smartgwt.client.widgets.grid.ListGrid;
    import com.smartgwt.client.widgets.layout.VLayout;
    
    public class BuiltInDS implements EntryPoint {
        private VLayout mainLayout;
        private IButton recreateBtn;
    
        public void onModuleLoad() {
            KeyIdentifier debugKey = new KeyIdentifier();
            debugKey.setCtrlKey(true);
            debugKey.setKeyName("D");
    
            Page.registerKey(debugKey, new PageKeyHandler() {
                public void execute(String keyName) {
                    SC.showConsole();
                }
            });
    
            mainLayout = new VLayout(20);
            mainLayout.setWidth100();
            mainLayout.setHeight100();
    
            recreateBtn = new IButton("Recreate");
            recreateBtn.addClickHandler(new ClickHandler() {
                @Override
                public void onClick(ClickEvent event) {
                    recreate();
                }
            });
            mainLayout.addMember(recreateBtn);
            recreate();
            mainLayout.draw();
        }
    
        private void recreate() {
            Window w = new Window();
            w.setWidth("95%");
            w.setHeight("95%");
            w.setMembersMargin(0);
            w.setModalMaskOpacity(70);
            w.setTitle(" (" + Version.getVersion() + "/" + Version.getSCVersionNumber() + ")");
            w.setTitle("TITLE" + w.getTitle());
            w.setShowMinimizeButton(false);
            w.setIsModal(true);
            w.setShowModalMask(true);
            w.centerInPage();
    
            final ListGrid employeesGrid = new ListGrid();
            employeesGrid.setHeight100();
            employeesGrid.setAutoFetchData(false);
            employeesGrid.setDataSource(DataSource.get("employees"));
    
            final DynamicForm df = new DynamicForm();
            SelectItem si = new SelectItem("GenderHC", "Select Gender (hardcoded)");
            si.setAllowEmptyValue(true);
            si.setMultiple(true);
            si.setDefaultToFirstOption(true);
            si.setValueMap("male", "female");
    
            ButtonItem bi = new ButtonItem("LOAD", "Load Data");
            bi.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
                @Override
                public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent event) {
                    employeesGrid.fetchData(df.getValuesAsAdvancedCriteria());
                }
            });
            df.setFields(si, bi);
    
            w.addItem(df);
            w.addItem(employeesGrid);
            w.show();
        }
    }
    Best regards
    Blama

    #2
    We've made a change to address this issue. Please try the next nightly build, dated June 9.

    Regards
    Isomorphic Software

    Comment


      #3
      Hi Isomorphic,

      the warnings are gone in my application using v10.1p_2016-06-09.

      Thank you,
      Blama

      Comment

      Working...
      X