Search code examples
gwtgxt

How to use Integer NumberField in GXT


I'm working with GXT3 and use :

NumberField<Double> code = new NumberField<Double>(new DoublePropertyEditor());

What i can use for "NumberField< Integer >"? there no IntegerPropertyEditor, i can't do simply:

NumberField<Integer> code = new NumberField<Integer>(new IntegerPropertyEditor());

Thanks to Patrice i use as solution:

NumberField<Integer> code = new NumberField<Integer>(new NumberPropertyEditor.IntegerPropertyEditor());

Solution

  • There are a IntegerPropertyEditor in the NumberPropertyEditor class.

    You can create a custom IntegerNumberField for simplify this :

    import com.sencha.gxt.widget.core.client.form.NumberPropertyEditor;
    
    public class IntegerNumberField extends BaseNumberField<Integer>{
    
      public IntegerNumberField() {
        super(new NumberPropertyEditor.IntegerPropertyEditor());
      }
    
    }