Re: Invoking Component#updateModel

2010-03-23 Thread Mauro Ciancio
thanks!

On Wed, Mar 24, 2010 at 1:30 AM, Igor Vaynberg  wrote:
> you are forcing an update without validation..up to you.
>
> -igor
>
> On Tue, Mar 23, 2010 at 8:15 PM, Mauro Ciancio  wrote:
>> Igor:
>>
>> On Tue, Mar 23, 2010 at 11:59 PM, Igor Vaynberg  
>> 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 
>>
>> -
>> 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 

-
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  wrote:
> Igor:
>
> On Tue, Mar 23, 2010 at 11:59 PM, Igor Vaynberg  
> 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 
>
> -
> 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  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 

-
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
see iformcomponentvalidator, or use component.getconvertedvalue()

-igor

On Tue, Mar 23, 2010 at 7:45 PM, Mauro Ciancio  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 
>
> -
> 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



Invoking Component#updateModel

2010-03-23 Thread Mauro Ciancio
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 

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