SubmitEvent called twice

18 views
Skip to first unread message

Bryan Buchanan

unread,
Jul 3, 2017, 4:38:16 AM7/3/17
to GwtBootstrap3
<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 ?

Steven Jardine

unread,
Jul 5, 2017, 10:12:43 AM7/5/17
to GwtBootstrap3
I would be happy to help you with this problem.  Would you please fork the gwtbootstrap3-seed project and create a test that exhibits the problem?

Thanks!
Steve

Bryan Buchanan

unread,
Jul 6, 2017, 3:45:09 AM7/6/17
to GwtBootstrap3
Hi Steve,

Thanks for the offer. I think I figured it out - I had 2 Form items on the page. Doh !

Bryan
Reply all
Reply to author
Forward
0 new messages