You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Patrick Davids <pa...@nubologic.com> on 2014/07/28 11:05:08 UTC

How to init a Wizard with a particular step?

Hi all,
what I have here is an persistent workflow and I use a wizard to 
visualize this workflow.

On entering my page I wanna push the wizard into a specific step 
depending on my persistent workflow state/(step).

Until now I only was able to achieve this, by manually calling 
wizardModel.next(); as many times I need to reach my particular active step.

(I will give a new try for calling setActiveStep(), but as far as I 
remember I wasnt able todo this, Not sure, why...
Anyway...)
My main reason, I dont want to do it this way is, I have to unpack my 
model-object on construction-time and I have to implement a kind of "if, 
else, if else..." and I have to do this after wizard.init(wizardModel) 
because the wizard resets itself. So I have to pay attention for 
call-sequence etc. First init(), than next(), next(), next()...

Is there any better way to achieve this?
Maybe, I just dont see the wood for the trees...
An override of "amITheActiveStep()"-method of WizardStep evaluated by 
the wizard to show an active step depending on conditions?

Thanx for feedback
Patrick
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to init a Wizard with a particular step?

Posted by Patrick Davids <pa...@nubologic.com>.
Hi Sebastien,
thanx, I have seen the DynamicWizardModel.

Its not exactly, what I need... will help for other reasons, but does 
not help not to unpack and evaluate my step while constructing.

My current implementation (I gave setActiveStep() a new chance) uses an 
onConfigure() of my Wizard calling getWizardModel().setActiveStep(...).

So, it also works with an usual WizardModel (dont know, what I made 
wrong some weeks ago).
I'm thinking about to keep this way...

thank you and kind regards
Patrick

Am 28.07.2014 11:21, schrieb Sebastien:
> Hi Patrick,
>
> Use a DynamicWizardModel
>
> private final IDynamicWizardStep step0;
>
> public MyWizard(String id)
> {
>      super(id);
>      final IWizardModel wizardModel = new DynamicWizardModel(this.step0); /*
> the start step */
>      this.init(wizardModel);
> }
>
> You have a complete demo here (using wicket-jquery-ui's wizard, but it's
> the same with the built-in wizard):
> http://www.7thweb.net/wicket-jquery-ui/wizard/DynamicWizardPage
>
> Hope this helps,
> Sebastien.
>
>
>
>
> On Mon, Jul 28, 2014 at 11:05 AM, Patrick Davids <
> patrick.davids@nubologic.com> wrote:
>
>> Hi all,
>> what I have here is an persistent workflow and I use a wizard to
>> visualize this workflow.
>>
>> On entering my page I wanna push the wizard into a specific step
>> depending on my persistent workflow state/(step).
>>
>> Until now I only was able to achieve this, by manually calling
>> wizardModel.next(); as many times I need to reach my particular active
>> step.
>>
>> (I will give a new try for calling setActiveStep(), but as far as I
>> remember I wasnt able todo this, Not sure, why...
>> Anyway...)
>> My main reason, I dont want to do it this way is, I have to unpack my
>> model-object on construction-time and I have to implement a kind of "if,
>> else, if else..." and I have to do this after wizard.init(wizardModel)
>> because the wizard resets itself. So I have to pay attention for
>> call-sequence etc. First init(), than next(), next(), next()...
>>
>> Is there any better way to achieve this?
>> Maybe, I just dont see the wood for the trees...
>> An override of "amITheActiveStep()"-method of WizardStep evaluated by
>> the wizard to show an active step depending on conditions?
>>
>> Thanx for feedback
>> Patrick
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>

-- 
Mit freundlichen Grüßen,

Patrick Davids

nuboLOGIC GmbH & Co. KG
Kieler Str. 103-107 • 25474 Bönningstedt

Tel.: +49 40 228539 732
Email: patrick.davids@nubologic.com

http://www.nubologic.com

Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg

Geschäftsführung der Verwaltungsgesellschaft
Daniel Fraga Zander

HRB10145Pi | Amtsgericht Pinneberg

Re: How to init a Wizard with a particular step?

Posted by Sebastien <se...@gmail.com>.
Hi Patrick,

Use a DynamicWizardModel

private final IDynamicWizardStep step0;

public MyWizard(String id)
{
    super(id);
    final IWizardModel wizardModel = new DynamicWizardModel(this.step0); /*
the start step */
    this.init(wizardModel);
}

You have a complete demo here (using wicket-jquery-ui's wizard, but it's
the same with the built-in wizard):
http://www.7thweb.net/wicket-jquery-ui/wizard/DynamicWizardPage

Hope this helps,
Sebastien.




On Mon, Jul 28, 2014 at 11:05 AM, Patrick Davids <
patrick.davids@nubologic.com> wrote:

> Hi all,
> what I have here is an persistent workflow and I use a wizard to
> visualize this workflow.
>
> On entering my page I wanna push the wizard into a specific step
> depending on my persistent workflow state/(step).
>
> Until now I only was able to achieve this, by manually calling
> wizardModel.next(); as many times I need to reach my particular active
> step.
>
> (I will give a new try for calling setActiveStep(), but as far as I
> remember I wasnt able todo this, Not sure, why...
> Anyway...)
> My main reason, I dont want to do it this way is, I have to unpack my
> model-object on construction-time and I have to implement a kind of "if,
> else, if else..." and I have to do this after wizard.init(wizardModel)
> because the wizard resets itself. So I have to pay attention for
> call-sequence etc. First init(), than next(), next(), next()...
>
> Is there any better way to achieve this?
> Maybe, I just dont see the wood for the trees...
> An override of "amITheActiveStep()"-method of WizardStep evaluated by
> the wizard to show an active step depending on conditions?
>
> Thanx for feedback
> Patrick
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>