RE: Wicket Wizzard Question / Custom Overview Bars
It's just a design decision ... the default design is that the steps are displayed on the left side (like in Jira's Wizard for example). But like Paul described you are free to change this like it fits for you. Best Regards, Marvin Richter -Original Message- From: Patrick Davids [mailto:patrick.dav...@nubologic.com] Sent: Monday, February 10, 2014 10:06 AM To: users@wicket.apache.org Subject: Re: Wicket Wizzard Question / Custom Overview Bars Hi Paul, thanx a lot for your detailed answer. :-) Helped much, but my primary question was, why the overviewbar is on the left hand side, not on the top. Possibly the header is what I am looking for, showing the current step information(?). But then, I still do not know, what the overviewbar was originally meant for. Patrick :-) Am 08.02.2014 19:36, schrieb Paul Bors: > Find the panel you want to modify, say the WizardButtonBar and extend it: > > public class MyWizardButtonBar extends WizardButtonBar { > private static final long serialVersionUID = 1L; > > public MyWizardButtonBar(String id, Wizard wizard, final boolean > finishOnAnyStep) { > super(id, wizard); > addOrReplace(new MyFinishButton("finish", wizard) { > private static final long serialVersionUID = 1L; > @Override > public boolean isEnabled() { > return (super.isEnabled() || finishOnAnyStep); > } > }); > } > } > > Then change its HTML to whatever you want, ie MyWizardButtonBar.html I > have > as: > http://wicket.apache.org";> > > > class="toolbox-form-submit" value="[Previous]" /> > class="toolbox-form-submit" value="[Next]" /> > class="toolbox-form-submit" value="[Last]" /> > class="toolbox-form-submit" value="[Cancel]" /> > class="toolbox-form-submit" value="[Finish]" /> > > > > > Finally, extend the Wizard itself and override the factory method you > need > changed: > > public class MyWizard extends Wizard { ... > @Override > protected Component newButtonBar(String id) { > return new MyWizardButtonBar(id, this, finishOnAnyStep()); > } > ... > } > > Then change the Wizard's HTML as you please but preserve the Wicket > component tree hirarachy. > Something like this: > > http://wicket.apache.org";> > > > > > > [[Overview]] > > > > > class="wicketExtensionsWizardHeader"> wicket:id="header">[[Header]] > > > class="wicketExtensionsWizardView"> class="wicketExtensionsWizardViewInner">[[View]] > > > class="wicketExtensionsWizardFeedback"> wicket:id="feedback">[[Feeback]] > > > class="wicketExtensionsWizardButtonBar"> wicket:id="buttons">[[Buttons]] > > > > > > > > > > On a side note, I didn't like the default of the Finish button so I > changed that too: > > public class MyFinishButton extends WizardButton { > private static final long serialVersionUID = 1L; > > public MyFinishButton(String id, IWizard wizard) { > super(id, wizard, "org.apache.wicket.extensions.wizard.finish"); > } > > /** > * @see org.apache.wicket.Component#isEnabled() > */ > public boolean isEnabled() { > IWizardStep activeStep = getWizardModel().getActiveStep(); > return (activeStep != null && > getWizardModel().isLastStep(activeStep)); > } > > /** > * @see org.apache.wicket.extensions.wizard.WizardButton#onClick() > */ > public final void onClick() { > IWizardModel wizardModel = getWizardModel(); > IWizardStep step = wizardModel.getActiveStep(); > > // let the step apply any state > step.applyState(); > > // if the step completed after applying the state, notify the wiza
Re: Wicket Wizzard Question / Custom Overview Bars
Hi Patrick, usually a wizard has an overview on the left side: http://en.wikipedia.org/wiki/Wizard_%28software%29 Regards Sven On 02/10/2014 10:04 AM, Patrick Davids wrote: Hi Paul, thanx a lot for your detailed answer. :-) Helped much, but my primary question was, why the overviewbar is on the left hand side, not on the top. Possibly the header is what I am looking for, showing the current step information(?). But then, I still do not know, what the overviewbar was originally meant for. Patrick :-) Am 08.02.2014 19:36, schrieb Paul Bors: Find the panel you want to modify, say the WizardButtonBar and extend it: public class MyWizardButtonBar extends WizardButtonBar { private static final long serialVersionUID = 1L; public MyWizardButtonBar(String id, Wizard wizard, final boolean finishOnAnyStep) { super(id, wizard); addOrReplace(new MyFinishButton("finish", wizard) { private static final long serialVersionUID = 1L; @Override public boolean isEnabled() { return (super.isEnabled() || finishOnAnyStep); } }); } } Then change its HTML to whatever you want, ie MyWizardButtonBar.html I have as: http://wicket.apache.org";> Finally, extend the Wizard itself and override the factory method you need changed: public class MyWizard extends Wizard { ... @Override protected Component newButtonBar(String id) { return new MyWizardButtonBar(id, this, finishOnAnyStep()); } ... } Then change the Wizard's HTML as you please but preserve the Wicket component tree hirarachy. Something like this: http://wicket.apache.org";> [[Overview]] [[Header]] [[View]] [[Feeback]] [[Buttons]] On a side note, I didn't like the default of the Finish button so I changed that too: public class MyFinishButton extends WizardButton { private static final long serialVersionUID = 1L; public MyFinishButton(String id, IWizard wizard) { super(id, wizard, "org.apache.wicket.extensions.wizard.finish"); } /** * @see org.apache.wicket.Component#isEnabled() */ public boolean isEnabled() { IWizardStep activeStep = getWizardModel().getActiveStep(); return (activeStep != null && getWizardModel().isLastStep(activeStep)); } /** * @see org.apache.wicket.extensions.wizard.WizardButton#onClick() */ public final void onClick() { IWizardModel wizardModel = getWizardModel(); IWizardStep step = wizardModel.getActiveStep(); // let the step apply any state step.applyState(); // if the step completed after applying the state, notify the wizard if(step.isComplete()) { getWizardModel().finish(); } else { error(getLocalizer().getString( "org.apache.wicket.extensions.wizard.FinishButton.step.did.not.complete", this) ); } } } On Fri, Feb 7, 2014 at 9:04 AM, Patrick Davids wrote: Hi all, did someone already noticed, a custom overriden overview-bar of wickets wizzard is displayed in a left of the Step contents ? I thought it would be on the top... Or did I misunderstood the meaning of the overview bar? Is it meant as kind of menu?! kind regards Patrick - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket Wizzard Question / Custom Overview Bars
Hi Paul, thanx a lot for your detailed answer. :-) Helped much, but my primary question was, why the overviewbar is on the left hand side, not on the top. Possibly the header is what I am looking for, showing the current step information(?). But then, I still do not know, what the overviewbar was originally meant for. Patrick :-) Am 08.02.2014 19:36, schrieb Paul Bors: > Find the panel you want to modify, say the WizardButtonBar and extend it: > > public class MyWizardButtonBar extends WizardButtonBar { > private static final long serialVersionUID = 1L; > > public MyWizardButtonBar(String id, Wizard wizard, final boolean > finishOnAnyStep) { > super(id, wizard); > addOrReplace(new MyFinishButton("finish", wizard) { > private static final long serialVersionUID = 1L; > @Override > public boolean isEnabled() { > return (super.isEnabled() || finishOnAnyStep); > } > }); > } > } > > Then change its HTML to whatever you want, ie MyWizardButtonBar.html I have > as: > http://wicket.apache.org";> > > > class="toolbox-form-submit" value="[Previous]" /> > class="toolbox-form-submit" value="[Next]" /> > class="toolbox-form-submit" value="[Last]" /> > class="toolbox-form-submit" value="[Cancel]" /> > class="toolbox-form-submit" value="[Finish]" /> > > > > > Finally, extend the Wizard itself and override the factory method you need > changed: > > public class MyWizard extends Wizard { > ... > @Override > protected Component newButtonBar(String id) { > return new MyWizardButtonBar(id, this, finishOnAnyStep()); > } > ... > } > > Then change the Wizard's HTML as you please but preserve the Wicket > component tree hirarachy. > Something like this: > > http://wicket.apache.org";> > > > > > > [[Overview]] > > > > > class="wicketExtensionsWizardHeader"> wicket:id="header">[[Header]] > > > class="wicketExtensionsWizardView"> class="wicketExtensionsWizardViewInner">[[View]] > > > class="wicketExtensionsWizardFeedback"> wicket:id="feedback">[[Feeback]] > > > class="wicketExtensionsWizardButtonBar"> wicket:id="buttons">[[Buttons]] > > > > > > > > > > On a side note, I didn't like the default of the Finish button so I changed > that too: > > public class MyFinishButton extends WizardButton { > private static final long serialVersionUID = 1L; > > public MyFinishButton(String id, IWizard wizard) { > super(id, wizard, "org.apache.wicket.extensions.wizard.finish"); > } > > /** > * @see org.apache.wicket.Component#isEnabled() > */ > public boolean isEnabled() { > IWizardStep activeStep = getWizardModel().getActiveStep(); > return (activeStep != null && > getWizardModel().isLastStep(activeStep)); > } > > /** > * @see org.apache.wicket.extensions.wizard.WizardButton#onClick() > */ > public final void onClick() { > IWizardModel wizardModel = getWizardModel(); > IWizardStep step = wizardModel.getActiveStep(); > > // let the step apply any state > step.applyState(); > > // if the step completed after applying the state, notify the wizard > if(step.isComplete()) { > getWizardModel().finish(); > } else { > error(getLocalizer().getString( > > "org.apache.wicket.extensions.wizard.FinishButton.step.did.not.complete", > this) > ); > } > } > } > > > On Fri, Feb 7, 2014 at 9:04 AM, Patrick Davids > wrote: > >> Hi all, >> did someone already noticed, a custom overriden overview-bar of wickets >> wizzard is displayed in a left of the Step contents ? >> >> I thought it would be on the top... >> >> Or did I misunderstood the meaning of the overview bar? >> Is it meant as kind of menu?! >> >> kind regards >> Patrick > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket Wizzard Question / Custom Overview Bars
Find the panel you want to modify, say the WizardButtonBar and extend it: public class MyWizardButtonBar extends WizardButtonBar { private static final long serialVersionUID = 1L; public MyWizardButtonBar(String id, Wizard wizard, final boolean finishOnAnyStep) { super(id, wizard); addOrReplace(new MyFinishButton("finish", wizard) { private static final long serialVersionUID = 1L; @Override public boolean isEnabled() { return (super.isEnabled() || finishOnAnyStep); } }); } } Then change its HTML to whatever you want, ie MyWizardButtonBar.html I have as: http://wicket.apache.org";> Finally, extend the Wizard itself and override the factory method you need changed: public class MyWizard extends Wizard { ... @Override protected Component newButtonBar(String id) { return new MyWizardButtonBar(id, this, finishOnAnyStep()); } ... } Then change the Wizard's HTML as you please but preserve the Wicket component tree hirarachy. Something like this: http://wicket.apache.org";> [[Overview]] [[Header]] [[View]] [[Feeback]] [[Buttons]] On a side note, I didn't like the default of the Finish button so I changed that too: public class MyFinishButton extends WizardButton { private static final long serialVersionUID = 1L; public MyFinishButton(String id, IWizard wizard) { super(id, wizard, "org.apache.wicket.extensions.wizard.finish"); } /** * @see org.apache.wicket.Component#isEnabled() */ public boolean isEnabled() { IWizardStep activeStep = getWizardModel().getActiveStep(); return (activeStep != null && getWizardModel().isLastStep(activeStep)); } /** * @see org.apache.wicket.extensions.wizard.WizardButton#onClick() */ public final void onClick() { IWizardModel wizardModel = getWizardModel(); IWizardStep step = wizardModel.getActiveStep(); // let the step apply any state step.applyState(); // if the step completed after applying the state, notify the wizard if(step.isComplete()) { getWizardModel().finish(); } else { error(getLocalizer().getString( "org.apache.wicket.extensions.wizard.FinishButton.step.did.not.complete", this) ); } } } On Fri, Feb 7, 2014 at 9:04 AM, Patrick Davids wrote: > Hi all, > did someone already noticed, a custom overriden overview-bar of wickets > wizzard is displayed in a left of the Step contents ? > > I thought it would be on the top... > > Or did I misunderstood the meaning of the overview bar? > Is it meant as kind of menu?! > > kind regards > Patrick
Wicket Wizzard Question / Custom Overview Bars
Hi all, did someone already noticed, a custom overriden overview-bar of wickets wizzard is displayed in a left of the Step contents ? I thought it would be on the top... Or did I misunderstood the meaning of the overview bar? Is it meant as kind of menu?! kind regards Patrick