|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectwicket.Component
wicket.MarkupContainer
wicket.markup.html.WebMarkupContainer
wicket.markup.html.WebMarkupContainerWithAssociatedMarkup
wicket.markup.html.panel.Panel
wicket.extensions.ajax.markup.html.modal.ModalWindow
Modal window component.
Modal window is a draggable window (with either div or iframe content) that prevent user from interacting the rest of page (using a mask) until the window is closed.
The window is draggable and optionally resizable. The content can be either
getContentId(), or
ModalWindow.PageCreator
instance to a setPageCreator(ModalWindow.PageCreator)
method.
show(AjaxRequestTarget)). In case the
content is another page, you can set the desired pagemap name using
setPageMapName(String). Setting pagemap is only
needed when wicket multiwindow support is on.
The window can be made visible from an ajax handler using
.
show(AjaxRequestTarget)
To close the window there are multiple options. Static method
can be used to close the
window from a handler of ajax link inside the window. By default the close
button in the upper right corner of the window closes it. This behavior can
be altered using
close(AjaxRequestTarget).
If you want to be notified when the window is closed (either using the close
button or calling setCloseButtonCallback(ModalWindow.CloseButtonCallback), you
can use
close(AjaxRequestTarget)).
setWindowClosedCallback(ModalWindow.WindowClosedCallback)
Title is specified using setTitle(String). If the content is a page
(iframe), the title can remain unset, in that case title from the page inside
window will be shown.
There are several options to specify the visual properties of the window. In all methods where size is expected, width refers to width of entire window (including frame), height refers to the height of window content (without frame).
setResizable(boolean) specifies, whether the
window can be resized.
setInitialWidth(int) and
setInitialHeight(int) specify the initial width and
height of window. If the window is resizable, the unit of these dimensions is
always "px". If the window is not resizable, the unit can be specified using
setWidthUnit(String) and
setHeightUnit(String). If the window is not
resizable and the content is a component (not a page), the initial height
value can be ignored and the actual height can be determined from the height
of the content. To enable this behavior use
setUseInitialHeight(boolean).
setCookieName(String). If
the name is null, position is not stored (initial width and
height are always used). Default cookie name is null (position is not stored).
setMinimalWidth(int) and
setMinimalHeight(int) set the minimal dimensions of
resizable window.
setCssClassName(String) sets the dialog css class,
possible values are CSS_CLASS_BLUE for blue frame and
CSS_CLASS_GRAY for gray frame.
setMaskType(ModalWindow.MaskType) alters this.
IPageSettings.setAutomaticMultiWindowSupport(boolean),
Serialized Form| Nested Class Summary | |
static interface |
ModalWindow.CloseButtonCallback
Callback for close button that contains a method that is invoked after the button has been clicked. |
static class |
ModalWindow.MaskType
Mask is the element behind the window, that prevents user from interacting the rest of page. |
static interface |
ModalWindow.PageCreator
Interface for lazy page creation. |
static interface |
ModalWindow.WindowClosedCallback
Callback called after the window has been closed. |
| Nested classes inherited from class wicket.markup.html.WebMarkupContainerWithAssociatedMarkup |
wicket.markup.html.WebMarkupContainerWithAssociatedMarkup.HeaderPartContainer |
| Nested classes inherited from class wicket.Component |
wicket.Component.ComponentModelChange, wicket.Component.EnabledChange, wicket.Component.IVisitor, wicket.Component.VisibilityChange |
| Field Summary | |
static java.lang.String |
CSS_CLASS_BLUE
CSS class for window with blue border. |
static java.lang.String |
CSS_CLASS_GRAY
CSS class for window with gray border. |
| Fields inherited from class wicket.Component |
ENABLE, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED6, FLAG_RESERVED7, FLAG_RESERVED8, PATH_SEPARATOR, RENDER |
| Constructor Summary | |
ModalWindow(java.lang.String id)
Creates a new modal window component. |
|
| Method Summary | |
static void |
close(wicket.ajax.AjaxRequestTarget target)
Hides the modal window. |
java.lang.String |
getContentId()
Returns the id of content component. |
java.lang.String |
getCookieName()
Returns the name of cookie that is used to remebember window position (and size if the window is resizable). |
java.lang.String |
getCssClassName()
Returns the CSS class name for this window. |
java.lang.String |
getHeightUnit()
Retrns the CSS unit for initial window height. |
int |
getInitialHeight()
Returns the initial height of the window. |
int |
getInitialWidth()
Returns the initial width of the window. |
ModalWindow.MaskType |
getMaskType()
Returns the mask type of the window |
int |
getMinimalHeight()
Returns the minimal height of window (in pixels). |
int |
getMinimalWidth()
Returns the minimal width of window (in pixels). |
java.lang.String |
getPageMapName()
Returns the page map name. |
java.lang.String |
getTitle()
Returns the title of the window. |
java.lang.String |
getWidthUnit()
Returns the CSS unit for initial window width. |
boolean |
isResizable()
Returns whether the window is resizable. |
boolean |
isUseInitialHeight()
Returns true if the initial height should be used (in favour of preserving real content height). |
protected void |
onAttach()
|
protected void |
onComponentTag(wicket.markup.ComponentTag tag)
|
void |
remove(wicket.Component component)
|
void |
setCloseButtonCallback(ModalWindow.CloseButtonCallback callback)
Sets the instance. |
void |
setContent(wicket.Component component)
Sets the content of the modal window. |
void |
setCookieName(java.lang.String cookieName)
Sets the name of the cookie that is used to remeber window position (and size if the window is resizable). |
void |
setCssClassName(java.lang.String cssClassName)
Sets the CSS class name for this window. |
void |
setHeightUnit(java.lang.String heightUnit)
Sets the CSS unit used for initial window height. |
void |
setInitialHeight(int initialHeight)
Sets the initial height of the window. |
void |
setInitialWidth(int initialWidth)
Sets the initial width of the window. |
void |
setMaskType(ModalWindow.MaskType mask)
Sets the mask type of the window. |
void |
setMinimalHeight(int minimalHeight)
Sets the minimal height of window. |
void |
setMinimalWidth(int minimalWidth)
Sets the minimal width of window. |
void |
setPageCreator(ModalWindow.PageCreator creator)
Sets the instance. |
void |
setPageMapName(java.lang.String pageMapName)
Sets the name of the page ma for the content page. |
void |
setResizable(boolean resizable)
Sets whether the user will be able to resize the window. |
void |
setTitle(java.lang.String title)
Sets the title of window. |
void |
setUseInitialHeight(boolean useInitialHeight)
Sets whether to use initial height or preserve the real content height. |
void |
setWidthUnit(java.lang.String widthUnit)
Sets the CSS unit used for initial window width. |
void |
setWindowClosedCallback(ModalWindow.WindowClosedCallback callback)
Sets the @{link instance. |
void |
show(wicket.ajax.AjaxRequestTarget target)
Shows the modal window. |
| Methods inherited from class wicket.markup.html.panel.Panel |
onComponentTagBody, renderHead |
| Methods inherited from class wicket.markup.html.WebMarkupContainerWithAssociatedMarkup |
newHeaderPartContainer, renderHeadFromAssociatedMarkupFile |
| Methods inherited from class wicket.markup.html.WebMarkupContainer |
getMarkupType, getWebPage |
| Methods inherited from class wicket.MarkupContainer |
add, autoAdd, contains, findMarkupStream, get, getAssociatedMarkupStream, getMarkupStream, internalAdd, internalAttach, internalDetach, isTransparentResolver, iterator, iterator, newMarkupResourceStream, onRender, remove, removeAll, renderAll, renderAssociatedMarkup, renderComponentTagBody, replace, setMarkupStream, setModel, size, toString, toString, visitChildren, visitChildren |
| Methods inherited from class wicket.Component |
add, addStateChange, checkComponentTag, checkComponentTagAttribute, continueToOriginalDestination, debug, detachBehaviors, detachModel, detachModels, error, exceptionMessage, fatal, findPage, findParent, findParentWithAssociatedMarkup, getApplication, getApplicationPages, getApplicationSettings, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getEscapeModelStrings, getFeedbackMessage, getFlag, getFlag, getId, getLocale, getLocalizer, getMarkupAttributes, getMarkupId, getMetaData, getModel, getModelComparator, getModelObject, getModelObjectAsString, getOutputMarkupId, getPage, getPageFactory, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getResponse, getSession, getSizeInBytes, getString, getString, getString, getStyle, getVariation, hasErrorMessage, hasFeedbackMessage, info, initModel, internalOnAttach, internalOnDetach, internalOnModelChanged, isActionAuthorized, isAncestorOf, isBehaviorAccepted, isEnableAllowed, isEnabled, isHeadRendered, isIgnoreAttributeModifier, isRenderAllowed, isVersioned, isVisible, isVisibleInHierarchy, modelChanged, modelChanging, newPage, newPage, onAfterRender, onBeforeRender, onBeginRequest, onDetach, onEndRequest, onModelChanged, onModelChanging, onRender, redirectToInterceptPage, remove, render, render, renderComponent, renderComponent, renderComponentTag, rendered, renderedBehaviors, replaceComponentTagBody, replaceWith, resetHeadRendered, sameRootModel, sameRootModel, setAuto, setEnabled, setEscapeModelStrings, setFlag, setFlag, setIgnoreAttributeModifier, setMetaData, setModelObject, setOutputMarkupId, setRedirect, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisible, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, warn |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.String CSS_CLASS_BLUE
public static final java.lang.String CSS_CLASS_GRAY
| Constructor Detail |
public ModalWindow(java.lang.String id)
id - Id of component| Method Detail |
public void setPageMapName(java.lang.String pageMapName)
pageMapName - Name of the page mappublic java.lang.String getPageMapName()
public void setPageCreator(ModalWindow.PageCreator creator)
ModalWindow.PageCreator instance. The instance is
only used when no custom component has been added to the dialog.
creator - ModalWindow.PageCreator instancepublic void setCloseButtonCallback(ModalWindow.CloseButtonCallback callback)
ModalWindow.CloseButtonCallback instance.
callback - Callback instancepublic void setWindowClosedCallback(ModalWindow.WindowClosedCallback callback)
@{link ModalWindow.WindowClosedCallback instance.
callback - Callback instancepublic void show(wicket.ajax.AjaxRequestTarget target)
target - Request target associated with current ajax request.public static final void close(wicket.ajax.AjaxRequestTarget target)
target - Request target associated with current ajax request.public java.lang.String getContentId()
ModalWindow window = new ModalWindow(parent, "window"); new MyPanel(window, window.getContentId());
public void setMinimalWidth(int minimalWidth)
minimalWidth - Minimal window width.public int getMinimalWidth()
public void setMinimalHeight(int minimalHeight)
minimalHeight - Minimal heightpublic int getMinimalHeight()
public void setCssClassName(java.lang.String cssClassName)
CSS_CLASS_BLUE and
CSS_CLASS_GRAY.
cssClassName - public java.lang.String getCssClassName()
public void setInitialWidth(int initialWidth)
setWidthUnit(String). If cookie name is set and
window is resizable, the initial width may be ignored in favor of width
stored in cookie.
initialWidth - Initial width of the windowpublic int getInitialWidth()
public void setInitialHeight(int initialHeight)
setHeightUnit(String). If cookie name is set
and window is resizable, the initial height may be ignred in favor of
height stored in cookie.
initialHeight - Initial height of the windowpublic int getInitialHeight()
public void setUseInitialHeight(boolean useInitialHeight)
useInitialHeight - Whether to use initial height instead of preserving content
height instead of using initial heightpublic boolean isUseInitialHeight()
public void setResizable(boolean resizable)
resizable - Whether the window is resizablepublic boolean isResizable()
public void setWidthUnit(java.lang.String widthUnit)
widthUnit - CSS unit for initial window width.public java.lang.String getWidthUnit()
public void setHeightUnit(java.lang.String heightUnit)
heightUnit - CSS unit for initial window height.public java.lang.String getHeightUnit()
public void setCookieName(java.lang.String cookieName)
cookieName - Name of the cookiepublic java.lang.String getCookieName()
public void setTitle(java.lang.String title)
null. In that case it will display the title document
inside the window.
title - Title of the windowpublic java.lang.String getTitle()
public void setMaskType(ModalWindow.MaskType mask)
mask - The mask typepublic ModalWindow.MaskType getMaskType()
protected void onAttach()
Component.onAttach()protected void onComponentTag(wicket.markup.ComponentTag tag)
Panel.onComponentTag(wicket.markup.ComponentTag)public void remove(wicket.Component component)
MarkupContainer.remove(wicket.Component)public void setContent(wicket.Component component)
component -
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||