Class PopupSettings

  • All Implemented Interfaces:
    java.io.Serializable, org.apache.wicket.util.io.IClusterable

    public class PopupSettings
    extends java.lang.Object
    implements org.apache.wicket.util.io.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

      Fields 
      Modifier and Type Field Description
      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

      Constructors 
      Constructor Description
      PopupSettings()
      Constructor.
      PopupSettings​(int displayFlags)
      Construct.
      PopupSettings​(java.lang.String windowName)
      Construct.
      PopupSettings​(java.lang.String windowName, int displayFlags)
      Construct.
    • Constructor Detail

      • PopupSettings

        public PopupSettings()
        Constructor.
      • PopupSettings

        public PopupSettings​(int displayFlags)
        Construct.
        Parameters:
        displayFlags - Display flags
      • PopupSettings

        public PopupSettings​(java.lang.String windowName)
        Construct.
        Parameters:
        windowName -
      • PopupSettings

        public PopupSettings​(java.lang.String windowName,
                             int displayFlags)
        Construct.
        Parameters:
        windowName - 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 java.lang.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​(java.lang.String target)
        Sets the target of the link. The default implementation simply refers to the href attribute of the anchor element, but clients may want to override this (e.g. when the HTML element is not an anchor) by setting the target explicitly. Note: if the target is an url (relative or absolute) then it should be wrapped in quotes, for example: setTarget("'some/url'"). If the url is delivered with an HTML attribute then it should be without quotes, for example: setTarget("this.dataset['popup-url']") with markup like:
        <a data-popup-url="some/url">Link</a>
        .
        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​(java.lang.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
        Parameters:
        popupWindowName - window name.
        Returns:
        This