Ok so I have been tinkering a bit with the Wizards for Vaadin addon. I managed to create a wizard that gets loaded into my view and all the steps within it. Now I have an issue however.
I am using different layouts, which I then load into my wizardSteps, such as e.g this:
public class Step2 implements WizardStep{
....
@Override
public Component getContent() {
Layout2 = new Layout2(model, wizard.getPlanes());
return Layout2;
}
....
}
This is working as intended, it fills the content of my
step2
with the
Layout2
and so forth…
Now, however what I am trying to achieve is the following:
I want to use a variable, that I get after completing
step1
… how do I achieve this? I wanted to do this via the onAdvance() method, but somehow this does not seem to work. When I check using the Debugger, I can see that prices is still empty (this means that at that time, the prices I selected via OptionGroup are still empty)
public class Step1 implements WizardStep{
String planes;
....
@Override
public Component getContent() {
Layout1 = new Layout1(odel);
return Layout1;
}
....
//I'm checking all optionGroups in Layout1 (have multiple for other reasons) and if they are selected,
//I can continue to the next step
public boolean onAdvance() {
for(OptionGroup optionGroup : Layout1.getOptionGroups()){
if(optionGroup.getValue() != null){
planes = getPlanes();
wizard.setPlanes(planes);
return true;
}
}
}
}