patrickherber
Jun 13th, 2007, 02:20 AM
Hello!
I have a Controller, which extends SimpleFormController, that is used to save changes of an Element object.
Usually on success, the user is "forwarded" to the Element-List page.
Now, beside the function "Save" on the form page, I would like to provide a "Save and new" function, which could be used to create more elements without the need each time to be "forwarded" to the list page (=> empty form => enter element Data => Save and new => empty form => ...).
I've tried to pass a parameter to the controller and accordingly set the the action parameter
if (actionID == SAVE_AND_NEW) {
response.setRenderParameter("action", "element");
} else {
response.setRenderParameter("action", "elementList");
}
but it does not work.
I've also tried to subclass my controller with one which specify a different successView (element instead of elementList), but this also didn't help.
How can I implement it?
Thanks a lot for your help.
Regards,
Patrick
I have a Controller, which extends SimpleFormController, that is used to save changes of an Element object.
Usually on success, the user is "forwarded" to the Element-List page.
Now, beside the function "Save" on the form page, I would like to provide a "Save and new" function, which could be used to create more elements without the need each time to be "forwarded" to the list page (=> empty form => enter element Data => Save and new => empty form => ...).
I've tried to pass a parameter to the controller and accordingly set the the action parameter
if (actionID == SAVE_AND_NEW) {
response.setRenderParameter("action", "element");
} else {
response.setRenderParameter("action", "elementList");
}
but it does not work.
I've also tried to subclass my controller with one which specify a different successView (element instead of elementList), but this also didn't help.
How can I implement it?
Thanks a lot for your help.
Regards,
Patrick