@UiHandler("frmSearch") void onSearchSubmit (SubmitEvent event) { if (isValid()) { PageTypeHelper.show(PageType.SearchPostsPageType, txtQuery.getValue()); txtQuery.setValue(""); } else { showErrors(); } event.cancel(); }
public SearchBoxViewGwtImpl() { FormPanel formPanel = new FormPanel(""); formPanel.addSubmitHandler(new SubmitHandler() { @Override public void onSubmit(SubmitEvent event) { event.cancel(); } }); MSearchBox searchBox = new MSearchBox(); formPanel.setWidget(searchBox); scrollPanel.setWidget(formPanel); }
/** * @see com.google.gwt.user.client.ui.FormPanel.SubmitHandler#onSubmit(com.google.gwt.user.client.ui.FormPanel.SubmitEvent) */ @Override public void onSubmit(SubmitEvent event) { dialog.hide(false); notification = notificationService.startProgressNotification( i18n.format("add-deployment-submit.adding-deployment"), //$NON-NLS-1$ i18n.format("add-deployment-submit.adding-deployment-msg")); //$NON-NLS-1$ }
@UiHandler("frmForm") void onFormSubmit (SubmitEvent se) { if (isValid()) { loading(); Form form = new Form(); form.name = name; // add fields to form final int count = pnlFields.getWidgetCount(); Widget current; Field field; for (int i = 0; i < count; i++) { current = pnlFields.getWidget(i); field = null; if (current instanceof FormField) { field = new Field().name(((FormField) current).name()) .value(((FormField) current).value()); if (form.fields == null) { form.fields = new ArrayList<Field>(); } form.fields.add(field); if (current instanceof TextBoxPart) { field.type(FieldTypeType.FieldTypeTypeText); } else if (current instanceof TextAreaPart) { field.type(FieldTypeType.FieldTypeTypeLongText); } else if (current instanceof ListBoxPart) { field.type(FieldTypeType.FieldTypeTypeSingleOption); } else if (current instanceof ReCaptchaPart) { field.type(FieldTypeType.FieldTypeTypeCaptcha); } } } FormController.get().submitForm(form); } se.cancel(); }
@UiHandler("answerForm") public void onFileFormSubmitComplete(SubmitEvent event) { this.fireEvent(new FormSubmitEvent(this)); }