You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "nebojsa.nedic" <ne...@gmail.com> on 2011/08/23 18:02:08 UTC

Wizard step - adding multiple addresses to one client

Hello all,

In second wizard step I would like to have an option to add several
addresses for one client (that is created in the first wizard step). I have
tried several options but none work out.

The best one that I currently have is that I have added additional "add"
button to the wizard step which is used to add address to the client. That
works OK, but if user fills in all address fields and then clicks "Next"
instead of "add", form will be validated but no address is added (because
"add" button adds the address to the client). Then I have added additional
form validation (new AbstractFormValidator()) and checked whether at least
one address is added. Because no address is added at the beginning, I always
get an error - good idea .

Now I am thinking to create a component that will have a model [Set<Address>
clientAddresses] but I don't know is this a good approach (and even am I
good enough to create this kind of component)? Also, I don't know how to
create component in a way that when I put component.setRequired(true) that
component checks whether there is at least one address added into the model?

Any ideas how to solve this kind of use case?

Thank you very much.

Regards,
Nebojsa

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wizard-step-adding-multiple-addresses-to-one-client-tp3763189p3763189.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Wizard step - adding multiple addresses to one client

Posted by "nebojsa.nedic" <ne...@gmail.com>.

I will definitely go to that direction and then we will see what will
happen.

Thank you Sven for your help.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wizard-step-adding-multiple-addresses-to-one-client-tp3763189p3765991.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Wizard step - adding multiple addresses to one client

Posted by Sven Meier <sv...@meiers.net>.
> Now I am thinking to create a component ... but I don't know is this
> a good approach

Sure, a panel allowing to manage addresses, sounds good.

> when I put component.setRequired(true) that component checks whether
> there is at least one address added into the model?

You could use WizardStep#add(IFormValidator) for a validator checking
the count of addresses.

Hope this helps
Sven

On 08/23/2011 06:02 PM, nebojsa.nedic wrote:
> Hello all,
> 
> In second wizard step I would like to have an option to add several
> addresses for one client (that is created in the first wizard step). I have
> tried several options but none work out.
> 
> The best one that I currently have is that I have added additional "add"
> button to the wizard step which is used to add address to the client. That
> works OK, but if user fills in all address fields and then clicks "Next"
> instead of "add", form will be validated but no address is added (because
> "add" button adds the address to the client). Then I have added additional
> form validation (new AbstractFormValidator()) and checked whether at least
> one address is added. Because no address is added at the beginning, I always
> get an error - good idea .
> 
> Now I am thinking to create a component that will have a model [Set<Address>
> clientAddresses] but I don't know is this a good approach (and even am I
> good enough to create this kind of component)? Also, I don't know how to
> create component in a way that when I put component.setRequired(true) that
> component checks whether there is at least one address added into the model?
> 
> Any ideas how to solve this kind of use case?
> 
> Thank you very much.
> 
> Regards,
> Nebojsa
> 
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wizard-step-adding-multiple-addresses-to-one-client-tp3763189p3763189.html
> Sent from the Users forum mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 


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