Class AjaxOperation
- java.lang.Object
-
- com.github.bordertech.wcomponents.AjaxOperation
-
- All Implemented Interfaces:
Serializable
public final class AjaxOperation extends Object implements Serializable
AjaxOperation describes an AJAX operation, which can replace one or more components.
See
setTargetContainerId(String)for details on how to set up lazy-loading.- Since:
- 1.0.0
- Author:
- Yiannis Paschalidis
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAjaxOperation.AjaxActionAJAX actions.
-
Constructor Summary
Constructors Constructor Description AjaxOperation(String triggerId)Creates an AjaxOperation for Internal AJAX Operation.AjaxOperation(String triggerId, String targetId)Creates an AjaxOperation.AjaxOperation(String triggerId, List<String> targetIds)Creates an AjaxOperation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AjaxOperation.AjaxActiongetAction()StringgetTargetContainerId()List<String>getTargets()StringgetTriggerId()booleanisInternalAjaxRequest()voidsetAction(AjaxOperation.AjaxAction action)voidsetTargetContainerId(String targetContainerId)Sets the target container id.
-
-
-
Constructor Detail
-
AjaxOperation
public AjaxOperation(String triggerId)
Creates an AjaxOperation for Internal AJAX Operation.- Parameters:
triggerId- the trigger id.WServletuses this as a look-up to obtain the correct AjaxOperation.
-
AjaxOperation
public AjaxOperation(String triggerId, String targetId)
Creates an AjaxOperation.- Parameters:
triggerId- the trigger id.WServletuses this as a look-up to obtain the correct AjaxOperation.targetId- the id of the target component.
-
-
Method Detail
-
setTargetContainerId
public void setTargetContainerId(String targetContainerId)
Sets the target container id. Allows you to replace a child component without affecting the parent. This is necessary for lazy loading components, where child content is not initially present, and can therefore not be replaced.- Parameters:
targetContainerId- the target container's id.
-
getTargetContainerId
public String getTargetContainerId()
- Returns:
- the target container's id
-
getTriggerId
public String getTriggerId()
- Returns:
- Returns the trigger id.
-
setAction
public void setAction(AjaxOperation.AjaxAction action)
- Parameters:
action- the AJAX action
-
getAction
public AjaxOperation.AjaxAction getAction()
- Returns:
- the AJAX action
-
isInternalAjaxRequest
public boolean isInternalAjaxRequest()
- Returns:
- true if AJAX operation is an internal AJAX request
-
-