cancel
Showing results for 
Search instead for 
Did you mean: 

Calling save while clicking on next button in wizard.

Former Member
0 Kudos

Hi,

I have given save tag(wz:save) inside next tag(wz:next). It is not saving the properties defined in prepare > initialize elements. Attached is code snippet for the same.Please provide some input.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI again,

Ok so if it is your hard requirement you can do following :

1) I've created an improvment in our backlog (TSB-1362) and that will be implemented in one of the following sprint and it will be released in 5.5 - then you can request patch for you version if it is acceptable for you ...

2) You can extend the ConfigurableFlowWidget according to this documentation: and modify the following methods in you custom controller:com.hybris.cockpitng.widgets.configurableflow.ConfigurableFlowController#doNext . The code may look like this below:

 public void doNext(final StepType currentStep)
 {
       super.doNext(currentStep);
       final NextType navigation = currentStep.getNavigation().getNext();
       for(final SaveType saveType : navigation.getSave()){
 
       try
       {
             persistProperty(saveType.getProperty());
       }
       catch (final ObjectSavingException e)
       {
           showFailureNotification(e);
       }
     }        
 }
 




Former Member
0 Kudos

I have one query?

I extended the controller class ConfigurableFlowController and created my CustomConfigurableFlowController.

I have to override the donext() method. But where to register my CustomConfigurableFlowController class such that it would be invoked on next click operation?

Thanks, Ashwini

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

".... if attributes of item1 are present in multiple steps,object will be persisted on each click of next button..."

if you share object like 'item1' on multpile steps and if you want to presist when the current step changes then you have to add correct navigation snippet for each step: ....

 <wz:navigation id="step1.navigation">
 <wz:cancel/>
 <wz:back/>
 <wz:next>
 <wz:save property="item1"/>
 </wz:next>
 </wz:navigation>
 .....
 <wz:navigation id="step2.navigation">
 <wz:cancel/>
 <wz:back/>
 <wz:next>
 <wz:save property="item1"/>
 </wz:next>
 </wz:navigation>

But if you don't neeed to persist item1 e.g. beetween 4th and 5th step then you can skip the navigation next snippet (especailly wz:save property="item1") then save method won't be performed ....

If you are wondering about performance - did you consider to perfomed this save only once when entire wizard is completed i.e. using done button ?

Regards Karol

Former Member
0 Kudos

Thank you for your information.

Again I have one more doubt.Consider if attributes of item1 are present in multiple steps,object will be persisted on each click of next button. If there is any not null field in later step, will cause problem while saving.There will also be performance issue as well.

Former Member
0 Kudos

Hi karol,

I have requirement like once particular step is completed(say step 1) item should be saved on clicking next.Once Step1 item is saved,in next step that item should also be populated and only then next step item should be created.

As per documentation, I had followed this step(mentioned in question).Below is link from where I got reference. https://wiki.hybris.com/display/release5/Configurable+Flow+Wizard+Widget

Former Member
0 Kudos

Hi,

We don't call save logic when wizard step is changed i.e. objectFacade.save is not called when next, previous button is clicked. In order to perist some properties defined in the please add:

 <wz:navigation id="step1.navigation">
     <wz:cancel/>
         <wz:back/>
         <wz:done>
             <wz:save property="newProduct"/>
     </wz:done>-
 </wz:navigation>

If you have different requirements please describe in details why you need that the newProduct hast to be persisted when wizard change the steps i.e. when in fact wizard is not finalized ....

Regards Karol