if you are setting the type The converter is called and not convertValue()
i am still not really happy with this but for 1.3/1.4 this is the way it
works
And i guess the String converter that does String to String doesnt óok at
that convert empty input to null value at all
Do you have your own?
Ok i guess if if quickly look at the code.
If you dont do your own converter then it defaults i guess to the
DefaultConverter
that does this:
public Object convertToObject(String value, Locale locale)
{
if (value == null)
{
return null;
I guess, if this was a real issue then more users would have reported it.
However, as a TextField is such an innocent component then any confusing
behaviour should be addressed. Maintaining a common behaviour of
setConvertEmptyInputStringToNull would do that and your proposed solution
looks good.
We already try to guess the type if the user doesn't set it (but not in
constructor but much later when the component/model hierarchy is completed)
But if the type is a String.class we will not set it and ignore it.
So you shouldn't set the type to String.class by default, only set it when
you
TexField.setConvertEmptyInputStringToNull( true ) worked fine for me
in a quickstart...
-igor
On Fri, Mar 28, 2008 at 8:25 AM, Eric Rotick [EMAIL PROTECTED] wrote:
I've just been reading the section on Forms and validation in Wicket in
Action and have tried
AbstractValidator av = new
Are you sure you dont have the type set?
Is a converter used or is convertInput called?
On 3/28/08, Eric Rotick [EMAIL PROTECTED] wrote:
Hmm, it's not working for me.
There's one other thing I spotted. The docs say that a TextField defaults to
String.class even if it cannot work out the class
I've just realised that the database is getting filled with columns of empty
strings which then don't cause the 'not null' test to trip.
The culprit is the TextField returning an empty string rather than a null. I
can see there are some special considerations for returning a null and I
want to