Announcement

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

    RecordClickHandler is NOT working for picklist!

    When setting picklist properties on a ComboBoxItem, the addRecordClickHandler does not get fired upon click.

    Here's a simple TestCase to show the problem.
    The TestDS is a GwtRpcDataSource in which implementation, the fetch returns a list of (Integer id, String name);

    Code:
    package org.test.client;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.google.gwt.user.client.Window;
    import com.smartgwt.client.widgets.form.DynamicForm;
    import com.smartgwt.client.widgets.form.fields.ComboBoxItem;
    import com.smartgwt.client.widgets.grid.ListGrid;
    import com.smartgwt.client.widgets.grid.ListGridField;
    import com.smartgwt.client.widgets.grid.events.RecordClickEvent;
    import com.smartgwt.client.widgets.grid.events.RecordClickHandler;
    import org.test.client.ds.TestDS;
    
    public class MainEntryPoint implements EntryPoint {
    
        private final DynamicForm form = new DynamicForm();
        private final TestDS datasource = new TestDS();
    
        public MainEntryPoint() {
        }
    
        @Override
        public void onModuleLoad() {
            ComboBoxItem combo = new ComboBoxItem("Test");
            combo.setValueField("id");
            combo.setDisplayField("name");
            combo.setOptionDataSource(datasource);
    
            ListGridField idField = new ListGridField("id");
            ListGridField nameField = new ListGridField("name");
            combo.setPickListFields(idField, nameField);
    
            ListGrid pickListProperties = new ListGrid();
            pickListProperties.addRecordClickHandler(new RecordClickHandler() {
    
                @Override
                public void onRecordClick(RecordClickEvent event) {
                    Window.alert("CLICKED");
                }
            });
            combo.setPickListProperties(pickListProperties);
    
            form.setItems(combo);
            form.draw();
        }
    }
    It doesn't work regardless of browser!

    GWT 2.5.1
    SmartGwt - latest nightly build from 2013-12-05
    (SmartGWT/4.0p/LGPL)

    #2
    A fix has been applied to 4.0 and you should see it in tonight's nightly build.

    Thanks.

    Comment


      #3
      Thank you!

      I confirm that it's fixed in SmartGWT/4.0p/LGPL 2013-12-11.

      Comment

      Working...
      X