|
What is an action |
A controller for processing transactional requests |
Actions work closely together with pages: a contains the form or script that initiates the transactional request. The action then processes it, making changes to the or session state. Then it redirects to another page that displays the result. Except if an error occurs: then it forwards to the previous page to let the user correct the input and try again.
The framework includes three generic actions: , and . These actions can be applied to any from the domain model whose class can be automatically included, i.e. all whose classes are in the application classFolder or in the root classFolder. They can be overridden the same way as pages, see how to specialize a page. ObjectSaveAction works on the same properties as ObjectEditDetailsPage. See how to override which propeties show up in the user interface.
You can create a custom action by subclassing PntAction or one of the above. For an example of a custom action see example 9.
The availability of generic actions has serious security implications: Users that understand html can manually create transactional requests that change almost everything in the domain model, unless you take appropriate security measures. See how to define what kinds of users can see and do what. |
|