Class AbstractPartialPageRequestHandler

    • Constructor Detail

      • AbstractPartialPageRequestHandler

        protected AbstractPartialPageRequestHandler​(Page page)
    • Method Detail

      • addChildren

        public final void addChildren​(MarkupContainer parent,
                                      Class<?> childCriteria)
        Description copied from interface: IPartialPageRequestHandler
        Visits all children of the specified parent container and adds them to the target if they are of same type as childCriteria
        Specified by:
        addChildren in interface IPartialPageRequestHandler
        Parameters:
        parent - Must not be null.
        childCriteria - Must not be null. If you want to traverse all components use ` Component.class as the value for this argument.
      • getPageParameters

        public final org.apache.wicket.request.mapper.parameter.PageParameters getPageParameters()
        Specified by:
        getPageParameters in interface IPageClassRequestHandler
        Returns:
        page parameters
      • add

        public final void add​(Component component,
                              String markupId)
        Description copied from interface: IPartialPageRequestHandler
        Adds a component to the list of components to be rendered
        Specified by:
        add in interface IPartialPageRequestHandler
        Parameters:
        component - component to be rendered
        markupId - id of client-side dom element that will be updated
      • prependJavaScript

        public final void prependJavaScript​(CharSequence javascript)
        Description copied from interface: IPartialPageRequestHandler
        Add JavaScript that will be evaluated on the client side before components are replaced.

        If the JavaScript needs to do something asynchronously (i.e. uses window.setTimeout(), for example to do animations), it may call Wicket.Ajax.suspendCall() to suspend the evaluation of the current Ajax call. The returned function has to be called when the asynchronous task is finished, after which the evaluation of the Ajax call is continued, e.g.

         target.prependJavaScript("var continueCall = Wicket.Ajax.suspendCall(); try { ... } finally { continueCall(); }");
         
        Important: it is recommended to execute your code in try/finally to make sure the function is executed even if an error happens in your code, otherwise all following scripts and component replacements wont be made.
        Specified by:
        prependJavaScript in interface IPartialPageRequestHandler
      • appendJavaScript

        public final void appendJavaScript​(CharSequence javascript)
        Description copied from interface: IPartialPageRequestHandler
        Add JavasSript that will be evaluated on the client side after components are replaced

        If the JavaScript needs to do something asynchronously (i.e. uses window.setTimeout(), for example to do animations), it may call Wicket.Ajax.suspendCall() to suspend the evaluation of the current Ajax call. The returned function has to be called when the asynchronous task is finished, after which the evaluation of the Ajax call is continued, e.g.

         target.appendJavaScript("var continueCall = Wicket.Ajax.suspendCall(); try { ... } finally { continueCall(); }");
         
        Important: it is recommended to execute your code in try/finally to make sure the function is executed even if an error happens in your code, otherwise all following scripts and component replacements wont be made.
        Specified by:
        appendJavaScript in interface IPartialPageRequestHandler
      • focusComponent

        public final void focusComponent​(Component component)
        Description copied from interface: IPartialPageRequestHandler
        Sets the focus in the browser to the given component. The markup id must be set. If the component is null the focus will not be set to any component.
        Specified by:
        focusComponent in interface IPartialPageRequestHandler
        Parameters:
        component - The component to get the focus or null.
      • getHeaderResponse

        public final IHeaderResponse getHeaderResponse()
        Description copied from interface: IPartialPageRequestHandler
        Returns the header response associated with current handler. Beware that only renderOnDomReadyJavaScript and renderOnLoadJavaScript can be called outside the renderHeader(IHeaderResponse response) method. Calls to other render** methods will result in the call failing with a debug-level log statement to help you see why it failed.
        Specified by:
        getHeaderResponse in interface IPartialPageRequestHandler
        Returns:
        header response