Not sure what the fuzz is all about: wicket trims the whitespace
before and after the input by default (like Marat already mentioned in
this thread).

Marat's code example is taken *directly* from Wicket's FormComponent.
You don't have to do anything.

Martijn

On Fri, Oct 2, 2009 at 3:06 PM, David Chang <[email protected]> wrote:
> For this to work, I have to overwrite this method either for each form or 
> write a custom class extending FormComponent. Correct?
>
> If yes, then it is not what I hope to get. I dont want to do it for each form 
> or a custom class.
>
> I came from Spring MVC camp. This task is very easy in Spring.
>
> Cheers.
>
> --- On Fri, 10/2/09, Marat Radchenko <[email protected]> wrote:
>
>> From: Marat Radchenko <[email protected]>
>> Subject: Re: Can Wicket automatically remove beginning and trailing spaces 
>> in  a text field?
>> To: [email protected]
>> Date: Friday, October 2, 2009, 4:00 AM
>> It already does that.
>> FormComponent:
>>
>> protected T convertValue(String[] value) throws
>> ConversionException
>> {
>> return (T)(value != null && value.length > 0
>> && value[0] != null ?
>> trim(value[0]) : null);
>> }
>>
>> 2009/10/2 David Chang <[email protected]>
>>
>> > How to set it up in a Wicket application? I would like
>> to set it up in the
>> > application level.
>> >
>> > Thanks!
>> >
>> >
>> >
>> >
>> >
>> ---------------------------------------------------------------------
>> > 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]
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.4 increases type safety for web applications
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0

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

Reply via email to