Berry van Halderen
b.vanhalderen at onehippo.com
Fri Oct 28 18:37:58 CEST 2011
On Fri, Oct 28, 2011 at 4:40 PM, Rogier Peters <rogier.peters at gmail.com> wrote:
> We're developing a wizard that hooks into the workflow. At the start
> of the wizard, obtainEditableInstance is called. When a user clicks
> next, node.getSession.save() is called. At the end of the wizard
> commitEditableInstance is called.
> The wizard has a cancel button, which is taken to mean: lose all the
> changes of the current step, but keep everything from previous steps.
> I implemented cancel with disposeEditableInstance, thinking that
> previous steps were saved by the node.getSession.save(), but I just
> realised that this throws away all changes, instead of those since the
> last save(). What is the right way to persist the intermediate steps,
> the way the 'save' button in the editor works?
Well, the save button in the editor is in fact just "sugar" for the action
"save&close" en then press "edit" immediately again. There is no "save"
option there. One of the options is do this the same way
wizard start -> obtainEditableInstance
intermediate -> save(), commitEditableInstance, obtainEditableInstance
back to previous -> refresh(false), disposeEditableInstance,
finish -> save(), commitEditableInstance
This would indeed obey your meaning of "lose all the changes of the
current step, but keep everything from previous steps". But that is
kinda different from most wizards i've seen.
More information about the Hippo-cms7-user