List of usage examples for org.apache.wicket.markup.html.form Form findForm
public static Form<?> findForm(Component component)
From source file:com.gmail.volodymyrdotsenko.jqxwicket.core.panel.FormSubmittingPanel.java
License:Apache License
@Override public Form<?> getForm() { return Form.findForm(this); }
From source file:com.googlecode.wicket.jquery.ui.form.button.ConfirmAjaxButton.java
License:Apache License
/** * Create the dialog instance<br/> * <b>Warning:</b> to be overridden with care! * * @param id the markupId//from w w w.jav a2 s . co m * @param title the title of the dialog * @param message the message to be displayed * @return the dialog instance */ protected AbstractFormDialog<?> newFormDialog(String id, IModel<String> title, IModel<String> message) { return new MessageFormDialog(id, title, message, DialogButtons.OK_CANCEL, DialogIcon.WARN) { private static final long serialVersionUID = 1L; @Override protected DialogButton getSubmitButton() { return this.findButton(LBL_OK); } @Override public Form<?> getForm() { return Form.findForm(ConfirmAjaxButton.this); } @Override protected void onError(AjaxRequestTarget target) { super.close(target, null); //the dialog does not close on error, by default. ConfirmAjaxButton.this.onError(target, this.getForm()); } @Override protected void onSubmit(AjaxRequestTarget target) { ConfirmAjaxButton.this.onSubmit(target, this.getForm()); } }; }
From source file:com.googlecode.wicket.kendo.ui.form.button.ConfirmAjaxButton.java
License:Apache License
/** * Create the window instance<br/> * <b>Warning:</b> to be overridden with care! * * @param id the markup id/*from ww w . j a v a 2 s . c o m*/ * @param title the title of the dialog * @param message the message to be displayed * @return the dialog instance */ protected Window<?> newWindow(String id, IModel<String> title, IModel<String> message, List<WindowButton> buttons) { return new MessageWindow(id, title, message, buttons, KendoIcon.NOTE) { private static final long serialVersionUID = 1L; @Override protected Form<?> getForm() { return Form.findForm(ConfirmAjaxButton.this); } @Override protected void onError(AjaxRequestTarget target, WindowButton button) { super.close(target); // closes the window on error. ConfirmAjaxButton.this.onError(target); } @Override public void onSubmit(AjaxRequestTarget target, WindowButton button) { if (button != null) { if (button.match(OK)) { ConfirmAjaxButton.this.onSubmit(target); } else if (button.match(CANCEL)) { ConfirmAjaxButton.this.onCancel(target); } } } }; }
From source file:de.alpharogroup.wicket.behaviors.models.UpdateModelVisitor.java
License:Apache License
/** * {@inheritDoc}//from www . ja v a 2 s.c o m */ @Override public void component(final FormComponent<?> formComponent, final IVisit<Void> visit) { if (formComponent instanceof IFormModelUpdateListener) { final Form<?> form = Form.findForm(formComponent); if (form != null) { if (this.form == null || this.form == form) { if (form.isEnabledInHierarchy()) { if (formComponent.isVisibleInHierarchy() && formComponent.isEnabledInHierarchy()) { formComponent.modelChanging(); ((IFormModelUpdateListener) formComponent).updateModel(); formComponent.modelChanged(); } } } } } }
From source file:net.dontdrinkandroot.wicket.bootstrap.component.form.ActionFormGroup.java
License:Apache License
public Form<?> getForm() { Form<?> form = Form.findForm(this); if (form == null) { throw new WicketRuntimeException("Could not find Form parent for " + this); }// ww w.j a v a2 s . c o m return form; }
From source file:org.geoserver.security.web.user.AbstractUserPage.java
License:Open Source License
boolean isFinalSubmit(FormComponent component) { return isFinalSubmit(Form.findForm(component)); }