Do I override the onFinish() method of my wizard or do I add a listener
to my wizard and put the logic there?  It looks like the wicket Wizard
that I am extending already implements the IWizardModelListener
[according to the java doc]  This will allow me to perform logic needed
when the wizard finishes.

I still don't know how to perform logic between step 1 and step 2.

Flow is:
Step 1 = ask for username
Step 1 = press next                                             ??????
Look up username in db and get additional info          ??????
Step 2 = present additional info for edit               ??????
Step 2 = press Finish
Update the db and set response page to send the user on their way


Do I use the onActiveStepChanged() method and use getActiveStep() to see
what step I am coming from and do my lookup if the active step is 1?

The examples don't show a good example of a wizard that uses data from
one step to present additional information in another step.  Otherwise
the examples are very good.

Thanks.

-----Original Message-----
From: Pedro Santos [mailto:pedros...@gmail.com] 
Sent: Friday, September 25, 2009 10:12 AM
To: users@wicket.apache.org
Subject: Re: Wizard help

I am just having trouble with the move from Step 1 to Step 2.  I assume
the success logic would be implemented in the onFinish() method of my
ForgotPasswordWizard

You can use an listener to implement success logic, onFinish will to be
called when Finish button get pressed
http://static.ddpoker.com/javadoc/wicket-extensions/1.4-m1/org/apache/wi
cket/extensions/wizard/IWizardModelListener.html

On Fri, Sep 25, 2009 at 11:00 AM, Jeffrey Schneller <
jeffrey.schnel...@envisa.com> wrote:

> Sorry for the duplicate post.  I don't think my first post went
through.
>
>
>
> I have looked at the examples and the javadocs but can't figure out
how
> to do the following.  I am a wicket newbie.
>
>
>
> I want to create a wizard with 2 steps implemented as panels.
>
>
>
> Step 1:  Asks the user to enter some information.  Validates that the
> information entered is in the database before moving to step 2.  [I
have
> this working]
>
> Step 2:  Based on the information entered in step 1, look in the db
for
> the matching data and display the rest of the information.  [part I am
> having trouble with]
>
>
>
> This is to implement a forgot password functionality.  Based on the
> username entered in step 1, look up a question in the db, then display
> the question to the user in step 2 so they can answer it.  Then after
> successfully answering the question perform some logic to reset the
> password.
>
>
>
> I am just having trouble with the move from Step 1 to Step 2.  I
assume
> the success logic would be implemented in the onFinish() method of my
> ForgotPasswordWizard
>
>
>
> The code  [just displaying the constructors]:
>
>
>
>       public ForgotPasswordWizard(String id) {
>
>              super(id);
>
>              ForgotPasswordModel bean = new ForgotPasswordModel();
>
>              setDefaultModel(new
> CompoundPropertyModel<ForgotPasswordModel>(bean));
>
>              WizardModel model = new WizardModel();
>
>              model.add(new ForgotPasswordStep1());
>
>              model.add(new ForgotPasswordStep2());
>
>              init(model);
>
>       }
>
>       public ForgotPasswordStep1() {
>
>              super(new Model("ForgotPasword"), new Model("Enter your
> username [email]"));
>
>              RequiredTextField username = new
> RequiredTextField("username");
>
>              username.add(EmailAddressValidator.getInstance());
>
>              add(username);
>
>              IFormValidator validator = new
AccountValidator(username);
>
>              this.add(validator);
>
>       }
>
>       public ForgotPasswordStep2() {
>
>              super(new Model("ForgotPasword"), new Model("Answer your
> Security Question"));
>
>
>
>              // ??????????????????????????????????????????????????
>
>              // find the question from the db for the user
>
>              ForgotPasswordModel myModel = (ForgotPasswordModel)
> this.getDefaultModelObject();
>
>              // access the db to get the actual question
>
>              myModel.setQuestion("[the question I shoud show]);
>
>              // ???????????????????????????????????????????????????
>
>
>
>              add(new Label("question"));
>
>              add(new RequiredTextField("answer"));
>
>       }
>
>
>
>
>
> Thanks.
>
>
>
> Jeff
>
>


-- 
Pedro Henrique Oliveira dos Santos

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to