java.lang.Object
org.apache.wicket.ajax.attributes.CallbackParameter
CallbackParameter
is a specification of a parameter that is used in an
AJAX callback
function. It specifies if and how the parameter is added to the function declaration, if and how
it is added to the AJAX callback and what code to use to generate the contents.- Author:
- papegaaij
-
Method Summary
Modifier and TypeMethodDescriptionstatic CallbackParameter
Add a parameter to the function declaration.static CallbackParameter
Add a parameter to the function declaration that is also passed to the AJAX callback, but converted.static CallbackParameter
Add a parameter to the function declaration that is also passed to the AJAX callback.static CallbackParameter
Add a parameter to the AJAX callback that is resolved inside the function, it will not be added as function parameter.
-
Method Details
-
context
Add a parameter to the function declaration. This parameter will not be passed to the AJAX callback. For example, the following code:getCallbackFunction(context("event"), context("ui"));
generates a function with two parameters, likefunction(event, ui) {...}
.- Parameters:
name
-- Returns:
- The parameter
-
explicit
Add a parameter to the function declaration that is also passed to the AJAX callback. For example, the following code:getCallbackFunction(explicit("param"));
generates a function with one parameter, likefunction(param) {...}
where 'param' is passed literally as extra parameter to the AJAX callback.- Parameters:
name
-- Returns:
- The parameter
-
resolved
Add a parameter to the AJAX callback that is resolved inside the function, it will not be added as function parameter. For example, the following code:getCallbackFunction(resolved("param", "global.substring(0, 3)"));
generates a function without parameters, likefunction() {...}
where the first 3 characters of the global variable 'global' are passed as extra parameter to the AJAX callback under the name 'param'.- Parameters:
name
-code
-- Returns:
- The parameter
-
converted
Add a parameter to the function declaration that is also passed to the AJAX callback, but converted. For example, the following code:getCallbackFunction(converted("param", "param.substring(0, 3)"));
generates a function with one parameter, likefunction(param) {...}
where the first 3 characters of 'param' are passed as extra parameter to the AJAX callback.- Parameters:
name
-code
-- Returns:
- The parameter
-
getFunctionParameterName
- Returns:
- the name of the parameter to add to the function declaration, or null if no parameter should be added.
-
getAjaxParameterName
- Returns:
- the name of the parameter to add to the AJAX callback, or null if no parameter should be added.
-
getAjaxParameterCode
- Returns:
- the javascript code to use to fill the parameter for the AJAX callback.
-