Interface IPartialPageRequestHandler
-
- All Superinterfaces:
IPageClassRequestHandler
,IPageRequestHandler
,org.apache.wicket.request.IRequestHandler
- All Known Subinterfaces:
AjaxRequestTarget
- All Known Implementing Classes:
AjaxRequestHandler
public interface IPartialPageRequestHandler extends IPageRequestHandler
Request handler that allows partial updates of the current page instance.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
add(Component... components)
Adds components to the list of components to be rendered.void
add(Component component, java.lang.String markupId)
Adds a component to the list of components to be renderedvoid
addChildren(MarkupContainer parent, java.lang.Class<?> childCriteria)
Visits all children of the specified parent container and adds them to the target if they are of same type aschildCriteria
void
appendJavaScript(java.lang.CharSequence javascript)
Adds javascript that will be evaluated on the client side after components are replacedvoid
focusComponent(Component component)
Sets the focus in the browser to the given component.java.util.Collection<? extends Component>
getComponents()
Returns an unmodifiable collection of all components added to this targetIHeaderResponse
getHeaderResponse()
Returns the header response associated with current handler.void
prependJavaScript(java.lang.CharSequence javascript)
Adds javascript that will be evaluated on the client side before components are replaced.-
Methods inherited from interface org.apache.wicket.core.request.handler.IPageClassRequestHandler
getPageClass, getPageParameters
-
Methods inherited from interface org.apache.wicket.core.request.handler.IPageRequestHandler
getPage, getPageId, getRenderCount, isPageInstanceCreated
-
-
-
-
Method Detail
-
add
void add(Component component, java.lang.String markupId)
Adds a component to the list of components to be rendered- Parameters:
markupId
- id of client-side dom element that will be updatedcomponent
- component to be rendered- Throws:
java.lang.IllegalArgumentException
- if the component is aPage
or anAbstractRepeater
java.lang.IllegalStateException
- if the components are currently being rendered, or have already been rendered
-
add
void add(Component... components)
Adds components to the list of components to be rendered.- Parameters:
components
- components to be rendered
-
addChildren
void addChildren(MarkupContainer parent, java.lang.Class<?> childCriteria)
Visits all children of the specified parent container and adds them to the target if they are of same type aschildCriteria
- 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.
-
appendJavaScript
void appendJavaScript(java.lang.CharSequence javascript)
Adds javascript that will be evaluated on the client side after components are replacedIf the javascript needs to do something asynchronously (i.e. needs to use window.setTimeout(), for example to do animations) then the following special syntax may be used:
someFunctionName|myJsLogic(someFunctionName);
. Wicket will transform it to:function(someFunctionName){myJsLogic(someFunctionName);}
and your code is responsible to execute someFunctionName() when the asynchronous task is finished. Once someFunctionName is executed the next appended script will be executed. Important: it is highly recommended to execute your code in try/finally to make sure someFunctionName is executed even an error happens in your code, otherwise all following scripts wont be executed.- Parameters:
javascript
-
-
prependJavaScript
void prependJavaScript(java.lang.CharSequence javascript)
Adds javascript that will be evaluated on the client side before components are replaced.If the javascript needs to do something asynchronously (i.e. needs to use window.setTimeout(), for example to do animations) then the following special syntax may be used:
someFunctionName|myJsLogic(someFunctionName);
. Wicket will transform it to:function(someFunctionName){myJsLogic(someFunctionName);}
and your code is responsible to execute someFunctionName() when the asynchronous task is finished. Once someFunctionName is executed the next prepended script will be executed. Important: it is highly recommended to execute your code in try/finally to make sure someFunctionName is executed even an error happens in your code, otherwise all following scripts and component replacements wont be made.- Parameters:
javascript
-
-
focusComponent
void focusComponent(Component component)
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.- Parameters:
component
- The component to get the focus or null.
-
getComponents
java.util.Collection<? extends Component> getComponents()
Returns an unmodifiable collection of all components added to this target- Returns:
- unmodifiable collection of all components added to this target
-
getHeaderResponse
IHeaderResponse getHeaderResponse()
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.- Returns:
- header response
-
-