ActionBox is a component containing the result of executing a controller action.
It accepts 3 main parameters: a controller, an action (optional, if not given, it executes the default controller's action) and a list of parameters (optional). The actionbox renders the result of executing the given action with the given parameters.
The ActionBox tag is "actionbox"
i.e.
<comp:actionbox controller = "invoiceList"
parameters = "list_type=simple&page_number=1" />
To improve the performance, by default an actionbox does not render the same action with the same parameters twice. It caches the latest response and serves it. However, we can force that execution by setting the autorefresh property to true.
Autorefresh = true will force the action execution for each new request (ajax requests not included).
Last, parameters set to the actionbox will be sent to the controller within the local request, not the global request. To recover the local request, we must ask the __ActionDispatcher
Add a parameter to be sent to the controller as part of the request
Parameters:
Type
Name
Description
string
$parameter_name
mixed
$parameter_value
Access:
public
clear
void clear(
)
Clear the actionbox content
Access:
public
clearParameters
void clearParameters(
)
Reset the parameters associated to the action execution
Access:
public
execute
void execute(
[
$force_execution = false]
)
Alias of executeAction
Parameters:
Type
Name
Description
$force_execution
Access:
public
executeAction
void executeAction(
[
$force_execution = false]
)
Executes the action associated to the current actionbox, setting the result to the actionbox response.
If autorefresh property is set to true (default value), the actionbox will be executed in each non-ajax request even if no new control values has been set (same action, same controller and same parameters)
Parameters:
Type
Name
Description
$force_execution
See:
__ActionBoxComponent::getResponse
Access:
public
getAction
string getAction(
)
Get the action code to be executed to.
Access:
public
getAutorefresh
bool getAutorefresh(
)
Get the autorefresh property
Access:
public
getContent
string getContent(
)
Alias of getResponse()
Access:
public
getController
string getController(
)
Get the controller code corresponding to the controller to be executed to
Access:
public
getParameters
array getParameters(
)
Get an array of parameters set to be sent within the local request to the action
Access:
public
getResponse
string getResponse(
)
Get the response that the current actionbox will be render to the client
Access:
public
isUnsynchronized
bool isUnsynchronized(
)
For interal usage only, this method checks if the current response can be rendered to the client
Access:
public
refresh
void refresh(
)
Forces the execution of the current action, refreshing the results in the action box
Access:
public
setAction
void setAction(
string
$action
)
Set the action code corresponding to the action to be executed to.
Parameters:
Type
Name
Description
string
$action
Access:
public
setAutorefresh
void setAutorefresh(
bool
$autorefresh
)
Set the autorefresh property
Parameters:
Type
Name
Description
bool
$autorefresh
Access:
public
setContent
void setContent(
string
$text
)
Alias of setResponse()
Parameters:
Type
Name
Description
string
$text
Access:
public
setController
void setController(
string
$controller
)
Set the controller code corresponding to the controller to be executed to
Parameters:
Type
Name
Description
string
$controller
Access:
public
setParameters
void setParameters(
mixed
$parameters
)
Set all the parameters in one-time call. Parameters can be either an array of pair key,value, or a comma-separated list of pairs
Parameters:
Type
Name
Description
mixed
$parameters
Access:
public
setResponse
void setResponse(
string
$text
)
Set the response that the current actionbox must render to the client.
This response is set as a result of the action execution, but can be set manually by calling this method