I added this to the wiki a while back 
http://cwiki.apache.org/WICKET/working-with-wicket-models.html

-----Original Message-----
From: Maurice Marrink [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 20, 2007 3:06 AM
To: [email protected]
Subject: Re: Add Form components


This happens because you gave your form a compoundpropertymodel.
which by default is used by any child component of the form unless it
has its own model explicitly set.
the solution is thus to give the confirmpassword field another model.
this can be a very simple model like new Model();
Then you can automate the equalitycheck on both passwordfields by
adding an EqualPasswordInputValidator to your form.

Maurice

On Nov 20, 2007 8:07 AM, tsuresh <[EMAIL PROTECTED]> wrote:
>
> Hello all
>   I have classes named User . User has two attributes name and password with
> getter and setter methods. I have another java class named UserAdd which
> contains the form . I added the form as below. But I could not add the new
> passwordTextField(confirmpassword) in it.When I try to add confirmpassword
> field as in commented code it says that there is no getter method for field
> confirmpassword in User class, but I don't want to add this confirmpassword
> in User class,  Please help.........
>
>  public UserAdd() {
>
>         CompoundPropertyModel userAddModel = new
> CompoundPropertyModel(user);
>
>         Form form = new userAddForm("user",userAddModel);
>         add(new FeedbackPanel("feedback"));
>         add(form);
>         TextField userNameComp = new TextField("username");
>         PasswordTextField passwordComp = new PasswordTextField("password");
>         // PasswordTextField confirmPasswordComp = new
> PasswordTextField("confirmPassword");
>
>
>         form.add(userNameComp);
>         form.add(passwordComp);
>         // form.add(confirmPasswordComp);
>
>     }
>
>     class userAddForm extends Form {
>         public userAddForm(String id,IModel model) {
>             super(id,model);
>         }
> .......
> ......
>     }
> }
>
> thanks
>
>
> --
> View this message in context: 
> http://www.nabble.com/Add-Form-components-tf4841628.html#a13851959
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to