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
Provides a modal dialog box that ask an input to the user
- Author:
- Sebastien Briquet - sebfz1
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.googlecode.wicket.jquery.ui.widget.dialog.AbstractFormDialog
AbstractFormDialog.DialogFormSubmitter
Nested classes/interfaces inherited from interface com.googlecode.wicket.jquery.core.IJQueryWidget
com.googlecode.wicket.jquery.core.IJQueryWidget.JQueryWidget
-
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
Fields inherited from class org.apache.wicket.markup.html.panel.Panel
PANEL
Fields inherited from class org.apache.wicket.Component
ENABLE, FLAG_INITIALIZED, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER, RFLAG_CONTAINER_DEQUEING, RFLAG_CONTAINER_HAS_REMOVALS
-
Constructor Summary
ConstructorsConstructorDescriptionInputDialog
(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
Modifier and TypeMethodDescriptionprotected List<DialogButton>
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 removedGets the button that is in charge to submit the form.
It should be in the list of buttons returned byAbstractDialog.getButtons()
boolean
Indicates whether the underlying input is requiredboolean
Indicates whether the dialog is resizableprotected org.apache.wicket.Component
Gets a newComponent
that 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 newFormComponent
that will be used as an input.
Override this method when you need to use aIValidator
or different input type, e.g.protected void
onDetach()
final void
onError
(org.apache.wicket.ajax.AjaxRequestTarget target, DialogButton button) Triggered when the form is submitted, but the validation failedprotected void
protected void
onOpen
(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler) Triggered when the dialog opensvoid
Deprecated.useless, will be removedMethods 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 org.apache.wicket.IQueueRegion
dequeue, newDequeueContext
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
InputDialog
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
- 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 Details
-
onInitialize
protected void onInitialize()- Overrides:
onInitialize
in classAbstractFormDialog<T extends Serializable>
-
onOpen
protected void onOpen(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler) Description copied from class:AbstractDialog
Triggered when the dialog opens- Overrides:
onOpen
in classAbstractDialog<T extends Serializable>
- Parameters:
handler
- theIPartialPageRequestHandler
-
onError
Description copied from class:AbstractFormDialog
Triggered when the form is submitted, but the validation failed- Specified by:
onError
in classAbstractFormDialog<T extends Serializable>
- Parameters:
target
- theAjaxRequestTarget
button
- theDialogButton
that submitted the form
-
onDetach
protected void onDetach()- Overrides:
onDetach
in classAbstractDialog<T extends Serializable>
-
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.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:AbstractFormDialog
Gets 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:
getForm
in 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:AbstractDialog
Indicates whether the dialog is resizable- Overrides:
isResizable
in classAbstractDialog<T extends Serializable>
- Returns:
- false by default
-
getButtons
Description copied from class:AbstractDialog
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.- Overrides:
getButtons
in classAbstractDialog<T extends Serializable>
- Returns:
AbstractDialog.btnOk
by default
-
getSubmitButton
Description copied from class:AbstractFormDialog
Gets the button that is in charge to submit the form.
It should be in the list of buttons returned byAbstractDialog.getButtons()
- Specified by:
getSubmitButton
in 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 newComponent
that 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 newFormComponent
that will be used as an input.
Override this method when you need to use aIValidator
or different input type, e.g.NumberTextField
orPasswordField
.- Parameters:
id
- the markup idmodel
- theIModel
- Returns:
- the new
FormComponent
-