[ 
https://issues.apache.org/jira/browse/LABS-491?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

jan iversen closed LABS-491.
----------------------------

    Resolution: Won't Fix

outdated and  closed, if not correct please reopen.

> [docs] Document form additional actions
> ---------------------------------------
>
>                 Key: LABS-491
>                 URL: https://issues.apache.org/jira/browse/LABS-491
>             Project: Labs
>          Issue Type: Improvement
>          Components: Magma
>    Affects Versions: Current
>            Reporter: Massimo Guidi
>             Fix For: Next
>
>
> Magma provide a simple way to enhance your forms by adding your custom 
> actions.
> In example we can simply create a class that extends CompleteCrudHandler to 
> add to our cruds a "Save and Go Back to List" action.
> public class AddAdminActionsWebHandler<T> extends CompleteCrudHandler<T>{
>       public AddAdminActionsWebHandler(Class<T> myBeanClass){
>               super(myBeanClass);
>       }
>       public HtmlProducer hiddenSaveAndBackToList(T bean){
>               new Database().save(bean);
>               return super.handleList().do_default();
>       }
>       @Override
>       public SmartForm handleNew(){
>               return super.handleNew()
>                       .addAction(new FormAction("Save and go back to the 
> list", "hiddenSaveAndBackToList", true, true));
>       }
> }
> As you can see this class simply override the CompleteCrudHandler's 
> handleNew() method adding the SmartForm's addAction(String label, String 
> method, boolean parametrized, boolean validate) method. 
> You can use this simple method directly in your own handlers simply using 
> "addAction".



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to