Description
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)
public HtmlProducer hiddenSaveAndBackToList(T bean)
{ new Database().save(bean); return super.handleList().do_default(); } @Override
public SmartForm handleNew()
}
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".