Wicket basic implementation of wizard steps

2019-08-08 00:38发布

问题:

is there any basic implementation wicket 6.20 provides for a step overview functionality like in this picture or like this if the other won't work?

When looking at the documentation I couldn't find anything close to it, so I started by doing my own implementation like

public List<String> getSteps(WizardModel model){
    Iterator<IWizardStep> iterator = model.stepIterator();
    List<String> steps = new ArrayList<String>();

    for(int i = 1; iterator.hasNext(); i++){
        steps.add(String.valueOf(i));
        iterator.next();
    }

    //model.getActiveStep(); unnecessary in this context
    return steps;
}   

to get all possible steps in a List. And now I would go on by getting the index of the current panel (if possible) and get it's state by isColmplete(); to mark it in a different color. But I can't believe, that I'm the first one with this problem.
Should I go on with my idea or is there a better option?

回答1:

You can (have to) implement a wizard yourself, it is not too hard.

I would use a AjaxTabbedPanel as basis. You just have to add a 'next', 'back' and 'finish' bar below, and do some CSS styling