Class ModalWindow

    • Constructor Detail

      • ModalWindow

        public ModalWindow​(String id)
        Deprecated.
        Creates a new modal window component.
        Parameters:
        id - Id of component
      • ModalWindow

        public ModalWindow​(String id,
                           IModel<?> model)
        Deprecated.
        Creates a new modal window component.
        Parameters:
        id - Id of component
        model - Model
    • Method Detail

      • newCssResource

        protected ResourceReference newCssResource()
        Deprecated.
        Allows to override CSS contribution. Returning null means the CSS will be contributed via other sources, e.g. a global CSS resource.
        Returns:
        The CSS resource reference or null if CSS is contributed via other means.
        See Also:
        setCssClassName(String)
      • isShown

        public boolean isShown()
        Deprecated.
        Is this window currently showing.
        Returns:
        the shown
      • show

        public void show​(IPartialPageRequestHandler target)
        Deprecated.
        Shows the modal window.
        Parameters:
        target - Request target associated with current ajax request.
      • closeCurrent

        public static void closeCurrent​(IPartialPageRequestHandler target)
        Deprecated.
        Hides the modal window. This can be called from within the modal window, however, the modal window must have configured WindowClosedCallback. Otherwise use the close(IPartialPageRequestHandler) method.
        Parameters:
        target - Request target associated with current ajax request.
      • close

        public void close​(IPartialPageRequestHandler target)
        Deprecated.
        Closes the modal window.
        Parameters:
        target - Request target associated with current ajax request.
      • getShowJavaScript

        protected CharSequence getShowJavaScript()
        Deprecated.
        Method that allows alternate script for showing the window.
        Returns:
        the script that actually shows the window.
      • getCloseJavacript

        protected String getCloseJavacript()
        Deprecated.
        Method that allows alternate script for closing the window.
        Returns:
        the script that actually closes the window.
      • getContentId

        public String getContentId()
        Deprecated.
        Returns the id of content component.
         ModalWindow window = new ModalWindow(parent, "window");
         new MyPanel(window, window.getContentId());
         
        Returns:
        Id of content component.
      • setMinimalWidth

        public ModalWindow setMinimalWidth​(int minimalWidth)
        Deprecated.
        Sets the minimal width of window. This value is only used if the window is resizable. The width is specified in pixels and it is the width of entire window (including frame).
        Parameters:
        minimalWidth - Minimal window width.
        Returns:
        this
      • getMinimalWidth

        public int getMinimalWidth()
        Deprecated.
        Returns the minimal width of window (in pixels).
        Returns:
        Minimal width of window
      • setMinimalHeight

        public ModalWindow setMinimalHeight​(int minimalHeight)
        Deprecated.
        Sets the minimal height of window. This value is only used if window is resizable. The height is specified in pixels and it is the height of window content (without frame).
        Parameters:
        minimalHeight - Minimal height
        Returns:
        this
      • getMinimalHeight

        public int getMinimalHeight()
        Deprecated.
        Returns the minimal height of window (in pixels).
        Returns:
        Minimal height of window
      • getCssClassName

        public String getCssClassName()
        Deprecated.
        Returns the CSS class name for this window.
        Returns:
        CSS class name
      • setInitialWidth

        public ModalWindow setInitialWidth​(int initialWidth)
        Deprecated.
        Sets the initial width of the window. The width refers to the width of entire window (including frame). If the window is resizable, the width unit is always "px". If the window is not resizable, the unit can be specified using setWidthUnit(String). If cookie name is set and window is resizable, the initial width may be ignored in favor of width stored in cookie.
        Parameters:
        initialWidth - Initial width of the window
        Returns:
        this
      • getInitialWidth

        public int getInitialWidth()
        Deprecated.
        Returns the initial width of the window.
        Returns:
        Initial height of the window
      • setInitialHeight

        public ModalWindow setInitialHeight​(int initialHeight)
        Deprecated.
        Sets the initial height of the window. The height refers to the height of window content (without frame). If the window is resizable, the height unit is always "px". If the window is not resizable, the unit can be specified using setHeightUnit(String). If cookie name is set and window is resizable, the initial height may be ignored in favor of height stored in cookie.
        Parameters:
        initialHeight - Initial height of the window
        Returns:
        this
      • getInitialHeight

        public int getInitialHeight()
        Deprecated.
        Returns the initial height of the window.
        Returns:
        Initial height of the window
      • setUseInitialHeight

        public ModalWindow setUseInitialHeight​(boolean useInitialHeight)
        Deprecated.
        Sets whether to use initial height or preserve the real content height. This can only be used if the content is a component (not a page) and the window is not resizable.
        Parameters:
        useInitialHeight - Whether to use initial height instead of preserving content height instead of using initial height
        Returns:
        this
      • isUseInitialHeight

        public boolean isUseInitialHeight()
        Deprecated.
        Returns true if the initial height should be used (in favor of preserving real content height).
        Returns:
        True if initial height should be used, false is real content height should be preserved (valid only if the window is not resizable and the content is a component (not a page)
      • setResizable

        public ModalWindow setResizable​(boolean resizable)
        Deprecated.
        Sets whether the user will be able to resize the window.
        Parameters:
        resizable - Whether the window is resizable
        Returns:
        this
      • isResizable

        public boolean isResizable()
        Deprecated.
        Returns whether the window is resizable.
        Returns:
        True if the window is resizable, false otherwise
      • showUnloadConfirmation

        public ModalWindow showUnloadConfirmation​(boolean unloadConfirmation)
        Deprecated.
        Sets a flag whether to ask the user before leaving the page.
        Parameters:
        unloadConfirmation - a flag whether to ask the user before leaving the page
        Returns:
        this instance, for chaining
      • showUnloadConfirmation

        public boolean showUnloadConfirmation()
        Deprecated.
        Returns whether the user should be asked before leaving the page.
        Returns:
        true if the user should be asked if the last action causes leaving the page, false otherwise
      • setWidthUnit

        public ModalWindow setWidthUnit​(String widthUnit)
        Deprecated.
        Sets the CSS unit used for initial window width. This is only applicable when the window is not resizable.
        Parameters:
        widthUnit - CSS unit for initial window width.
        Returns:
        this
      • getWidthUnit

        public String getWidthUnit()
        Deprecated.
        Returns the CSS unit for initial window width.
        Returns:
        CSS unit for initial window width.
      • setHeightUnit

        public ModalWindow setHeightUnit​(String heightUnit)
        Deprecated.
        Sets the CSS unit used for initial window height. This is only applicable when the window is not resizable.
        Parameters:
        heightUnit - CSS unit for initial window height.
        Returns:
        this
      • getHeightUnit

        public String getHeightUnit()
        Deprecated.
        Retrns the CSS unit for initial window height.
        Returns:
        CSS unit for initial window height.
      • setCookieName

        public ModalWindow setCookieName​(String cookieName)
        Deprecated.
        Sets the name of the cookie that is used to remember window position (and size if the window is resizable).
        Parameters:
        cookieName - Name of the cookie
        Returns:
        this
      • getCookieName

        public String getCookieName()
        Deprecated.
        Returns the name of cookie that is used to remember window position (and size if the window is resizable).
        Returns:
        Name of the cookie
      • setTitle

        public ModalWindow setTitle​(String title)
        Deprecated.
        Sets the title of window. If the window is a page, title can be null. In that case it will display the title document inside the window.
        Parameters:
        title - Title of the window
        Returns:
        this
      • setTitle

        public ModalWindow setTitle​(IModel<String> title)
        Deprecated.
        Sets the title of window. If the window is a page, title can be null. In that case it will display the title document inside the window.
        Parameters:
        title - Title of the window
        Returns:
        this
      • getTitle

        public IModel<StringgetTitle()
        Deprecated.
        Returns the title of the window.
        Returns:
        Title of the window
      • onBeforeRender

        protected void onBeforeRender()
        Deprecated.
        Description copied from class: Component
        Called on all visible components before any component is rendered.

        NOTE: If you override this, you *must* call super.onBeforeRender() within your implementation. Because this method is responsible for cascading Component.onBeforeRender() call to its children it is strongly recommended that super call is made at the end of the override.

        Changes to the component tree can be made only before calling super.onBeforeRender().
        Overrides:
        onBeforeRender in class Component
        See Also:
        Component.onBeforeRender()
      • makeContentVisible

        protected boolean makeContentVisible()
        Deprecated.
        You may subclass this method in case you don't want to show up the window on normal page refresh.
        Returns:
        true, if the window shall be shown
      • getContent

        protected final Component getContent()
        Deprecated.
        Returns a content component. In case user haven't specified any content component, it returns an empty WebMarkupContainer.
        Returns:
        Content component
      • isCustomComponent

        protected boolean isCustomComponent()
        Deprecated.
        Returns true if user has added own component to the window.
        Returns:
        True if user has added own component to the window, false otherwise.
      • setContent

        public ModalWindow setContent​(Component component)
        Deprecated.
        Sets the content of the modal window.
        Parameters:
        component -
        Returns:
        this;
      • postProcessSettings

        protected void postProcessSettings​(com.github.openjson.JSONObject settings)
        Deprecated.
        Method that allows tweaking the settings
        Parameters:
        settings -
      • setAutoSize

        public ModalWindow setAutoSize​(boolean autoSize)
        Deprecated.
        Sets whether window size will be automatically adjusted on opening to fit content's width and height. Doesn't work on IE 6.
        Parameters:
        autoSize - Whether window size will be automatically adjusted
        Returns:
        this
      • isAutoSize

        public boolean isAutoSize()
        Deprecated.
        Returns whether window will be opened in autosize mode.
        Returns:
        True if the window will be opened open in autosize mode, false otherwise