Hi
2010/6/18 Paul Stanton
> When I use a Hidden component on a form for a bean property of type Integer
> with a null value...
>
>
>
> ... I get the following error when submitting:
>
> Caused by: java.lang.RuntimeException: Coercion of to type
> java.lang.Integer (via String --> Long, Long --> Integer) failed: For input
> string: ""
> at
> org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl$TargetCoercion.coerce(TypeCoercerImpl.java:69)
> at
> org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl.coerce(TypeCoercerImpl.java:133)
>
> However, if i change the markup to:
>
> style="display:none;" />
>
> there is no problem.
>
> I guess it's because Hidden doesn't use the default null handler
> (NullFieldStrategy) like TextField, but surely they should behave the same
> in this regard?
>
In fact Hidden component uses ValueEncoder to encode/decode the value
parameter :
http://tapestry.apache.org/tapestry5.1/tapestry-core/ref/org/apache/tapestry5/corelib/components/Hidden.html
>
> bug?
>
> p.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>
--
Regards,
Christophe Cordenier.
Developer of wooki @wookicentral.com