Accessing wizard datasources in step controller onActivate() method

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 -

  1. Define wizard xml and steps along with datasources as shown in checkout wizard example.
  2. Add all step screens
  3. Load customer information on step one based on customer code/id selection by user.
  4. On step change listener (from step1 to step2) - we populate datasource for step -2 based on user selection in step1.
  5. We attach this datasource to different UI components on step 2. All is good until this point.
  6. 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.
  7. When step2 screen is rendered - and when we access datasource on say changelistener of a checkbox - we again see correct data in the datasource.
  8. 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?


can you provide a small test project (perhaps based on GitHub - mariodavid/cuba-example-using-wizard: Showcase project for using cuba-component-wizard) and then show where exactly what is missing and how you would like it to be?

Then it will be easier to help you :slight_smile:

Thanks & Cheers