<b:Form type="HORIZONTAL" submitOnEnter="true" ui:field="quantityform">
<b:FormGroup ui:field="formGroupQuantity">
<b:FormLabel for="quantity" addStyleNames="col-md-3">
Quantity
<span style="color:red">*</span>
</b:FormLabel>
<g:FlowPanel addStyleNames="col-md-1">
<b:TextBox b:id="quantity" ui:field="quantity" />
</g:FlowPanel>
</b:FormGroup>
</b:Form>.
@UiHandler("quantityform")
void onQuantitySubmit(SubmitEvent e) {
bjb += 1;
po.setText(bjb + "");
e.cancel();
}
Got the UI binder code above, and the Java handler. "bjb" is set to zero. When I press [return] in the quantity textbox, bjb always increments by 2 (alternatively if I have a Window.alert() it is shown twice).
Does anyone know why the SubmitEvent handler is called twice ?