We are implementing wizard for simple workflow in our organization - we select customer on first step and have lot of relevant details to show/edit on following screens. When we inject the datasource(s) already defined on ‘-wizard.xml’ file in the controller - it looses the customer information selected on previous step inside onActivate() method.
Here is what we have done -
- Define wizard xml and steps along with datasources as shown in checkout wizard example.
- Add all step screens
- Load customer information on step one based on customer code/id selection by user.
- On step change listener (from step1 to step2) - we populate datasource for step -2 based on user selection in step1.
- We attach this datasource to different UI components on step 2. All is good until this point.
- Now - we need to render some of the fields in disabled state when step 2 is rendered. So we use step2 controller to achieve this. But inside onActivate() when we access datasource for step2 - we notice that it does not have correct data - but it loads entire table associated with that datasource.
- When step2 screen is rendered - and when we access datasource on say changelistener of a checkbox - we again see correct data in the datasource.
- We tried this with or without super.onActivate() as the first step inside onActivate() method.
This is not the only scenario. There are and will be other scenarios in which we will need access to datasource inside onActivate() method.
Let us know your thoughts! Anything we are missing? or any workaround you would like to suggest?