Re: Invoking Component#updateModel

2010-03-23 Thread Igor Vaynberg
see iformcomponentvalidator, or use component.getconvertedvalue()

-igor

On Tue, Mar 23, 2010 at 7:45 PM, Mauro Ciancio maurocian...@gmail.com wrote:
 Hello everyone,

  I'm coding a form validator that validates some condition in a form.
 This validator needs the value from two textfields, but the model's
 value isn't set when the validators run.

  Is a bad practice calling Component#updateModel to get the updated
 value from the model?
  I could get the component's value using #getInput but I'd need
 convert the raw value.

 Cheers.
 --
 Mauro Ciancio maurociancio at gmail dot com

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



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



Re: Invoking Component#updateModel

2010-03-23 Thread Mauro Ciancio
Igor:

On Tue, Mar 23, 2010 at 11:59 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote:
 see iformcomponentvalidator, or use component.getconvertedvalue()

Thanks for the advice.

  But my textfield's model is a chained model. I mean, I construct the
textfield like this:

DateTextField dateTextField = new DateTextField(id,
new Date2LocalDateAdapterModel(new propertymodel(...) ));

  So, if i call getconvertedvalue I would get a Date and not a LocalDate.

If I call updateModel the value is propagated through the chained
models and i dont need an extra conversion.

Is this too ugly?
Thanks.
-- 
Mauro Ciancio maurociancio at gmail dot com

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



Re: Invoking Component#updateModel

2010-03-23 Thread Igor Vaynberg
you are forcing an update without validation..up to you.

-igor

On Tue, Mar 23, 2010 at 8:15 PM, Mauro Ciancio maurocian...@gmail.com wrote:
 Igor:

 On Tue, Mar 23, 2010 at 11:59 PM, Igor Vaynberg igor.vaynb...@gmail.com 
 wrote:
 see iformcomponentvalidator, or use component.getconvertedvalue()

 Thanks for the advice.

  But my textfield's model is a chained model. I mean, I construct the
 textfield like this:

 DateTextField dateTextField = new DateTextField(id,
                new Date2LocalDateAdapterModel(new propertymodel(...) ));

  So, if i call getconvertedvalue I would get a Date and not a LocalDate.

 If I call updateModel the value is propagated through the chained
 models and i dont need an extra conversion.

 Is this too ugly?
 Thanks.
 --
 Mauro Ciancio maurociancio at gmail dot com

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



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



Re: Invoking Component#updateModel

2010-03-23 Thread Mauro Ciancio
thanks!

On Wed, Mar 24, 2010 at 1:30 AM, Igor Vaynberg igor.vaynb...@gmail.com wrote:
 you are forcing an update without validation..up to you.

 -igor

 On Tue, Mar 23, 2010 at 8:15 PM, Mauro Ciancio maurocian...@gmail.com wrote:
 Igor:

 On Tue, Mar 23, 2010 at 11:59 PM, Igor Vaynberg igor.vaynb...@gmail.com 
 wrote:
 see iformcomponentvalidator, or use component.getconvertedvalue()

 Thanks for the advice.

  But my textfield's model is a chained model. I mean, I construct the
 textfield like this:

 DateTextField dateTextField = new DateTextField(id,
                new Date2LocalDateAdapterModel(new propertymodel(...) ));

  So, if i call getconvertedvalue I would get a Date and not a LocalDate.

 If I call updateModel the value is propagated through the chained
 models and i dont need an extra conversion.

 Is this too ugly?
 Thanks.
 --
 Mauro Ciancio maurociancio at gmail dot com

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



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





-- 
Mauro Ciancio maurociancio at gmail dot com

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