PDA

View Full Version : [FNR] SpinnerField doesn't honor setEnabled(false) on triggers



bartolomiew
15 Sep 2010, 6:24 AM
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.extjs.gxt.ui.client.widget.form.SpinnerField;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.i18n.client.NumberFormat;
import com.google.gwt.user.client.ui.RootPanel;

public class TestSpinner implements EntryPoint {

@Override
public void onModuleLoad() {

FormPanel formPanel = new FormPanel();

SpinnerField spinnerField = new SpinnerField();
spinnerField.setFieldLabel("Spinner disabled");
spinnerField.setIncrement(Integer.valueOf(1));
spinnerField.setPropertyEditorType(Integer.class);
spinnerField.setFormat(NumberFormat.getFormat("##0"));
spinnerField.setAutoValidate(true);
spinnerField.setAllowDecimals(false);
spinnerField.setAllowBlank(false);
spinnerField.setMinValue(0);
spinnerField.setMaxValue(50);
spinnerField.setValue(25);

// you can change spinner value with triggers
// even with setEnabled(false);
spinnerField.setEnabled(false);

formPanel.add(spinnerField);

RootPanel.get().add(formPanel);

}


}

sven
15 Sep 2010, 6:33 AM
Fixed in SVN as of revision 2229. There was already a patch pending.

bartolomiew
15 Sep 2010, 6:36 AM
Thanks, I'm grabbing the revision 2229