PDA

View Full Version : NumberField



liondev
15 Apr 2011, 12:07 PM
I have a usal number field

NumberField pagoefectivo = new NumberField();
pagoefectivo.setName("pago");
pagoefectivo.setSelectOnFocus(true);
pagoefectivo.setFieldLabel("Paga con");
//private final NumberFormat currency = NumberFormat.getCurrencyFormat();
pagoefectivo.setFormat(currency);
pagoefectivo.setPropertyEditorType(Float.class);
pagoefectivo.setAllowNegative(false);
pagoefectivo.setAllowBlank(false);


then its binding

FormBinding binding = new FormBinding(view.getForm(), true);
binding.bind(model);

The model its a BeanModelTag bean, whit a float property

private float pago;
getters and setters


The problem is when you delete all text on the numberfield and then the widget lose the focus
then its a Exception


com.google.gwt.event.shared.UmbrellaException: One or more exceptions caught, see full set in UmbrellaException#getCauses
at com.google.gwt.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:214)
at com.google.gwt.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:103)
at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:101)
at com.google.gwt.user.client.Event$NativePreviewEvent.fire(Event.java:87)
etc ...


Caused by: java.lang.NullPointerException: null
at com.test.Proyecto.shared.Model.TestBean.BeanModel_com_test_Proyecto_shared_Model_TestBean_TestBeanDTO.set(BeanModel_com_test_Proyecto_shared_Model_TestBean_TestBeanDTO.java:179)
at com.extjs.gxt.ui.client.binding.FieldBinding.updateModel(FieldBinding.java:222)
at com.extjs.gxt.ui.client.binding.FieldBinding.onFieldChange(FieldBinding.java:242)
at com.extjs.gxt.ui.client.binding.FieldBinding$1.handleEvent(FieldBinding.java:54)
at com.extjs.gxt.ui.client.binding.FieldBinding$1.handleEvent(FieldBinding.java:1)
at com.extjs.gxt.ui.client.event.BaseObservable.callListener(BaseObservable.java:178)
at com.extjs.gxt.ui.client.event.BaseObservable.fireEvent(BaseObservable.java:86)
at com.extjs.gxt.ui.client.widget.Component.fireEvent(Component.java:455)


this a bug?