Wizard step - adding multiple addresses to one client

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Wizard step - adding multiple addresses to one client

nebojsa.nedic
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
Reply | Threaded
Open this post in threaded view
|

Re: Wizard step - adding multiple addresses to one client

Sven Meier
> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Wizard step - adding multiple addresses to one client

nebojsa.nedic


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

Thank you Sven for your help.