org.apache.wicket.markup.html.link
Class PopupSettings

java.lang.Object
  extended by org.apache.wicket.markup.html.link.PopupSettings
All Implemented Interfaces:
Serializable, IClusterable

public class PopupSettings
extends Object
implements IClusterable

A popup specification can be used as a property of the Linkclasses to specify that the link should be rendered with an onClick javascript event handler that opens a new window with the links' URL.

You can 'or' display flags together like this:

 new PopupSettings(PopupSettings.RESIZABLE | PopupSettings.SCROLLBARS);
 

Author:
Jonathan Locke, Eelco Hillenius
See Also:
Serialized Form

Field Summary
static int LOCATION_BAR
          Flag to include location bar
static int MENU_BAR
          Flag to include menu bar
static int RESIZABLE
          Flag to make popup resizable
static int SCROLLBARS
          Flag to include scrollbars
static int STATUS_BAR
          Flag to include status bar
static int TOOL_BAR
          Flag to include location bar
 
Constructor Summary
PopupSettings()
          Construct.
PopupSettings(int displayFlags)
          Construct.
PopupSettings(IPageMap pagemap)
          Deprecated. Use the PopupSettings(String)
PopupSettings(IPageMap pageMapName, int displayFlags)
          Deprecated. Use the PopupSettings(String, int)
PopupSettings(String pageMapName)
          Construct.
PopupSettings(String pageMapName, int displayFlags)
          Construct.
 
Method Summary
 IPageMap getPageMap()
          Deprecated. will be removed in Wicket 2.0; use getPageMap(Component) instead
 IPageMap getPageMap(Component callee)
          Deprecated. Use getPageMapName instead. There is no need to eager create the pagemap object to create URLs. The pagemap will be created during the request cycle when user click on the link for this popup.
 String getPageMapName(Component callee)
          Gets the page map name.
 String getPopupJavaScript()
          Get the onClick javascript event handler.
 PopupSettings setHeight(int popupHeight)
          Sets the popup window height.
 PopupSettings setLeft(int popupPositionLeft)
          Sets the left position of the popup window.
 void setTarget(String target)
          Sets the target of the link.
 PopupSettings setTop(int popupPositionTop)
          Sets the top position of the popup window.
 PopupSettings setWidth(int popupWidth)
          Sets the popup window width.
 PopupSettings setWindowName(String popupWindowName)
          Sets the window name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCATION_BAR

public static final int LOCATION_BAR
Flag to include location bar

See Also:
Constant Field Values

MENU_BAR

public static final int MENU_BAR
Flag to include menu bar

See Also:
Constant Field Values

RESIZABLE

public static final int RESIZABLE
Flag to make popup resizable

See Also:
Constant Field Values

SCROLLBARS

public static final int SCROLLBARS
Flag to include scrollbars

See Also:
Constant Field Values

STATUS_BAR

public static final int STATUS_BAR
Flag to include status bar

See Also:
Constant Field Values

TOOL_BAR

public static final int TOOL_BAR
Flag to include location bar

See Also:
Constant Field Values
Constructor Detail

PopupSettings

public PopupSettings()
Construct. If you are not using these popup settings with an external link - in which case we don't need to know about a page map - you should use one of the constructors with a PageMap argument. Typically, you should put any popup in a separate page map as Wicket holds references to a limited number of pages/ versions only. If you don't put your popup in a separate page map, the user might get page expired exceptions when getting back to the main window again.


PopupSettings

public PopupSettings(int displayFlags)
Construct.

Parameters:
displayFlags - Display flags

PopupSettings

@Deprecated
public PopupSettings(IPageMap pagemap)
Deprecated. Use the PopupSettings(String)

Construct.

Parameters:
pagemap - The pagemap where this popup must be in. Typically, you should put any popup in a separate page map as Wicket holds references to a limited number of pages/ versions only. If you don't put your popup in a separate page map, the user might get page expired exceptions when getting back to the main window again.

PopupSettings

public PopupSettings(String pageMapName)
Construct.

Parameters:
pageMapName - The page map name where this popup must be in. Typically, you should put any popup in a separate page map as Wicket holds references to a limited number of pages/ versions only. If you don't put your popup in a separate page map, the user might get page expired exceptions when getting back to the main window again.

PopupSettings

@Deprecated
public PopupSettings(IPageMap pageMapName,
                                int displayFlags)
Deprecated. Use the PopupSettings(String, int)


PopupSettings

public PopupSettings(String pageMapName,
                     int displayFlags)
Construct.

Parameters:
pageMapName - The pagemap where this popup must be in. Typically, you should put any popup in a separate page map as Wicket holds references to a limited number of pages/ versions only. If you don't put your popup in a separate page map, the user might get page expired exceptions when getting back to the main window again.
displayFlags - Display flags
Method Detail

getPopupJavaScript

public String getPopupJavaScript()
Get the onClick javascript event handler.

Returns:
the onClick javascript event handler

setHeight

public PopupSettings setHeight(int popupHeight)
Sets the popup window height.

Parameters:
popupHeight - the popup window height.
Returns:
This

setLeft

public PopupSettings setLeft(int popupPositionLeft)
Sets the left position of the popup window.

Parameters:
popupPositionLeft - the left position of the popup window.
Returns:
This

setTarget

public void setTarget(String target)
Sets the target of the link. The default implementation simply refers to the href element, but clients may want to override this (e.g. when the HTML element is not an anchor) by setting the target explicitly.

Parameters:
target - the target of the link

setTop

public PopupSettings setTop(int popupPositionTop)
Sets the top position of the popup window.

Parameters:
popupPositionTop - the top position of the popup window.
Returns:
This

setWidth

public PopupSettings setWidth(int popupWidth)
Sets the popup window width.

Parameters:
popupWidth - the popup window width.
Returns:
This

setWindowName

public PopupSettings setWindowName(String popupWindowName)
Sets the window name. The logical name of the window. This can be anything you want, although you should use alphanumeric characters only (no spaces or punctuation). If you have a window already open and call window.open a second time using the same windowName, the first window will be reused rather than opening a second window An page map with popupWindowName will to be used when it is set, so this method also set the page map name.

Parameters:
popupWindowName - window name.
Returns:
This

getPageMap

@Deprecated
public IPageMap getPageMap()
Deprecated. will be removed in Wicket 2.0; use getPageMap(Component) instead

Gets the pagemap where the popup page must be created in.

Returns:
The pagemap where the popup page must be created in

getPageMap

@Deprecated
public IPageMap getPageMap(Component callee)
Deprecated. Use getPageMapName instead. There is no need to eager create the pagemap object to create URLs. The pagemap will be created during the request cycle when user click on the link for this popup.

Gets the pagemap where the popup page must be created in.

Parameters:
callee - Calling component
Returns:
The pagemap where the popup page must be created in

getPageMapName

public String getPageMapName(Component callee)
Gets the page map name. Used to create URLs referencing the popup on the defined page map.

Parameters:
callee -
Returns:
the page map name


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.