Class InputDialog<T extends Serializable>
- java.lang.Object
-
- org.apache.wicket.Component
-
- org.apache.wicket.MarkupContainer
-
- org.apache.wicket.markup.html.WebMarkupContainer
-
- org.apache.wicket.markup.html.panel.Panel
-
- org.apache.wicket.markup.html.panel.GenericPanel<T>
-
- com.googlecode.wicket.jquery.ui.widget.dialog.AbstractDialog<T>
-
- com.googlecode.wicket.jquery.ui.widget.dialog.AbstractFormDialog<T>
-
- com.googlecode.wicket.jquery.ui.widget.dialog.InputDialog<T>
-
- Type Parameters:
T- the type of the model object of theTextField
- All Implemented Interfaces:
com.googlecode.wicket.jquery.core.IJQueryWidget,IDialogListener,Serializable,Iterable<org.apache.wicket.Component>,org.apache.wicket.event.IEventSink,org.apache.wicket.event.IEventSource,org.apache.wicket.feedback.IFeedbackContributor,org.apache.wicket.IConverterLocator,org.apache.wicket.IGenericComponent<T,org.apache.wicket.markup.html.panel.GenericPanel<T>>,org.apache.wicket.IMetadataContext<Serializable,org.apache.wicket.Component>,org.apache.wicket.IQueueRegion,org.apache.wicket.markup.html.IHeaderContributor,org.apache.wicket.request.component.IRequestableComponent,org.apache.wicket.util.IHierarchical<org.apache.wicket.Component>,org.apache.wicket.util.io.IClusterable
public abstract class InputDialog<T extends Serializable> extends AbstractFormDialog<T>
Provides a modal dialog box that ask an input to the user- Author:
- Sebastien Briquet - sebfz1
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.googlecode.wicket.jquery.ui.widget.dialog.AbstractFormDialog
AbstractFormDialog.DialogFormSubmitter
-
-
Field Summary
-
Fields inherited from class com.googlecode.wicket.jquery.ui.widget.dialog.AbstractDialog
CANCEL, CLOSE, LBL_CANCEL, LBL_CLOSE, LBL_NO, LBL_OK, LBL_SUBMIT, LBL_YES, NO, OK, SUBMIT, YES
-
-
Constructor Summary
Constructors Constructor Description InputDialog(String id, String title, String label)Constructor supplying a new default model.InputDialog(String id, String title, String label, org.apache.wicket.model.IModel<T> model)InputDialog(String id, org.apache.wicket.model.IModel<String> title, org.apache.wicket.model.IModel<String> label)Constructor supplying a new default model.InputDialog(String id, org.apache.wicket.model.IModel<String> title, org.apache.wicket.model.IModel<String> label, org.apache.wicket.model.IModel<T> model)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected List<DialogButton>getButtons()Gets the dialog's buttons.
It is allowed to return a predefined list (ie: DialogButtons#OK_CANCEL#toList()) as long as the buttons state (enable and/or visible) are not modified
Warning: It is not legal to create the buttons to be returned in this method.org.apache.wicket.markup.html.form.Form<?>getForm()Gets the form to be validated by this dialog.
Warning, the onSubmit and the onError are being delegated to this dialog.org.apache.wicket.model.IModel<String>getLabel()Deprecated.useless, will be removedDialogButtongetSubmitButton()Gets the button that is in charge to submit the form.
It should be in the list of buttons returned byAbstractDialog.getButtons()booleanisRequired()Indicates whether the underlying input is requiredbooleanisResizable()Indicates whether the dialog is resizableprotected org.apache.wicket.ComponentnewLabel(String id, org.apache.wicket.model.IModel<String> model)Gets a newComponentthat will be used as a label in the dialog.
Override this method when you need to show formatted label.protected org.apache.wicket.markup.html.form.FormComponent<T>newTextField(String id, org.apache.wicket.model.IModel<T> model)Gets a newFormComponentthat will be used as an input.
Override this method when you need to use aIValidatoror different input type, e.g.protected voidonDetach()voidonError(org.apache.wicket.ajax.AjaxRequestTarget target, DialogButton button)Triggered when the form is submitted, but the validation failedprotected voidonInitialize()protected voidonOpen(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)Triggered when the dialog opensvoidsetLabel(org.apache.wicket.model.IModel<String> label)Deprecated.useless, will be removed-
Methods inherited from class com.googlecode.wicket.jquery.ui.widget.dialog.AbstractFormDialog
getDefaultFormProcessing, getForm, getModelComparator, newButtonAjaxBehavior, onClose, onModelChanged, onSubmit
-
Methods inherited from class com.googlecode.wicket.jquery.ui.widget.dialog.AbstractDialog
close, findButton, getTitle, getWidth, isDefaultCloseEventEnabled, isEscapeCloseEventEnabled, isModal, newDialogListenerWrapper, newWidgetBehavior, onBeforeRender, onClick, onConfigure, open, setTitle, setTitle, setTitle
-
Methods inherited from class org.apache.wicket.markup.html.panel.Panel
getRegionMarkup, newMarkupSourcingStrategy
-
Methods inherited from class org.apache.wicket.markup.html.WebMarkupContainer
getWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSession
-
Methods inherited from class org.apache.wicket.MarkupContainer
add, addDequeuedComponent, addOrReplace, autoAdd, canDequeueTag, contains, dequeue, dequeue, dequeuePreamble, findChildComponent, findComponentToDequeue, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, internalAdd, internalInitialize, iterator, iterator, newDequeueContext, onComponentTagBody, onRender, queue, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, stream, streamChildren, toString, toString, visitChildren, visitChildren
-
Methods inherited from class org.apache.wicket.Component
add, addStateChange, beforeRender, canCallListener, canCallListenerAfterExpiry, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, clearOriginalDestination, configure, continueToOriginalDestination, createConverter, debug, detach, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findMarkupStream, findPage, findParent, findParentWithAssociatedMarkup, getAjaxRegionMarkupId, getApplication, getBehaviorById, getBehaviorId, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessages, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkup, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdFromMarkup, getMarkupIdImpl, getMarkupSourcingStrategy, getMarkupTag, getMetaData, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getRequestFlag, getResponse, getSession, getSizeInBytes, getStatelessHint, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalOnModelChanged, internalRenderComponent, internalRenderHead, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isInitialized, isRenderAllowed, isRendering, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, onAfterRender, onBeforeRender, onComponentTag, onConfigure, onEvent, onModelChanging, onReAdd, onRemove, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderPart, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, urlFor, urlFor, urlFor, urlForListener, urlForListener, visitParents, visitParents, warn, wrap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.wicket.IGenericComponent
getDefaultModel, getDefaultModelObject, getModel, getModelObject, setDefaultModel, setDefaultModelObject, setModel, setModelObject
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
InputDialog
public InputDialog(String id, String title, String label)
Constructor supplying a new default model.- Parameters:
id- the markupId, an html div suffice to host a dialog.title- the title of the dialoglabel- text that will be displayed in front of the text field.
-
InputDialog
public InputDialog(String id, org.apache.wicket.model.IModel<String> title, org.apache.wicket.model.IModel<String> label)
Constructor supplying a new default model.- Parameters:
id- the markupId, an html div suffice to host a dialog.title- the title of the dialoglabel- text that will be displayed in front of the text field.
-
InputDialog
public InputDialog(String id, String title, String label, org.apache.wicket.model.IModel<T> model)
- Parameters:
id- the markupId, an html div suffice to host a dialog.title- the title of the dialoglabel- text that will be displayed in front of the text field.model- the model to be used
-
InputDialog
public InputDialog(String id, org.apache.wicket.model.IModel<String> title, org.apache.wicket.model.IModel<String> label, org.apache.wicket.model.IModel<T> model)
- Parameters:
id- the markupId, an html div suffice to host a dialog.title- the title of the dialoglabel- text that will be displayed in front of the text field.model- the model to be used
-
-
Method Detail
-
onInitialize
protected void onInitialize()
- Overrides:
onInitializein classAbstractFormDialog<T extends Serializable>
-
onOpen
protected void onOpen(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
Description copied from class:AbstractDialogTriggered when the dialog opens- Overrides:
onOpenin classAbstractDialog<T extends Serializable>- Parameters:
handler- theIPartialPageRequestHandler
-
onError
public final void onError(org.apache.wicket.ajax.AjaxRequestTarget target, DialogButton button)Description copied from class:AbstractFormDialogTriggered when the form is submitted, but the validation failed- Specified by:
onErrorin classAbstractFormDialog<T extends Serializable>- Parameters:
target- theAjaxRequestTargetbutton- theDialogButtonthat submitted the form
-
onDetach
protected void onDetach()
- Overrides:
onDetachin classAbstractDialog<T extends Serializable>
-
getLabel
@Deprecated public org.apache.wicket.model.IModel<String> getLabel()
Deprecated.useless, will be removedSets the text that will be displayed in front of the text field.- Returns:
- the dialog's label
-
setLabel
@Deprecated public void setLabel(org.apache.wicket.model.IModel<String> label)
Deprecated.useless, will be removedSets the text that will be displayed in front of the text field.- Parameters:
label- the dialog's label
-
getForm
public org.apache.wicket.markup.html.form.Form<?> getForm()
Description copied from class:AbstractFormDialogGets the form to be validated by this dialog.
Warning, the onSubmit and the onError are being delegated to this dialog. However, it does not prevent the use of Form#onSubmit nor Form#onError- Specified by:
getFormin classAbstractFormDialog<T extends Serializable>- Returns:
- the form
-
isRequired
public boolean isRequired()
Indicates whether the underlying input is required- Returns:
- true by default
-
isResizable
public boolean isResizable()
Description copied from class:AbstractDialogIndicates whether the dialog is resizable- Overrides:
isResizablein classAbstractDialog<T extends Serializable>- Returns:
- false by default
-
getButtons
protected List<DialogButton> getButtons()
Description copied from class:AbstractDialogGets the dialog's buttons.
It is allowed to return a predefined list (ie: DialogButtons#OK_CANCEL#toList()) as long as the buttons state (enable and/or visible) are not modified
Warning: It is not legal to create the buttons to be returned in this method.- Overrides:
getButtonsin classAbstractDialog<T extends Serializable>- Returns:
AbstractDialog.btnOkby default
-
getSubmitButton
public DialogButton getSubmitButton()
Description copied from class:AbstractFormDialogGets the button that is in charge to submit the form.
It should be in the list of buttons returned byAbstractDialog.getButtons()- Specified by:
getSubmitButtonin classAbstractFormDialog<T extends Serializable>- Returns:
- the submit button
-
newLabel
protected org.apache.wicket.Component newLabel(String id, org.apache.wicket.model.IModel<String> model)
Gets a newComponentthat will be used as a label in the dialog.
Override this method when you need to show formatted label.- Parameters:
id- the markup idmodel- the labelIModel- Returns:
- the new label component.
-
newTextField
protected org.apache.wicket.markup.html.form.FormComponent<T> newTextField(String id, org.apache.wicket.model.IModel<T> model)
Gets a newFormComponentthat will be used as an input.
Override this method when you need to use aIValidatoror different input type, e.g.NumberTextFieldorPasswordField.- Parameters:
id- the markup idmodel- theIModel- Returns:
- the new
FormComponent
-
-