You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Shing Hing Man <ma...@yahoo.com> on 2009/03/28 14:57:44 UTC

String to Double Type Coercion problem in 5.1.0.2 snapshot

I have a TextField component to input a Double. 


   	@Component(id = "MatrixEntry", parameters ={ "validate=prop:fieldValidator"})
	private TextField entry;
	
<INPUT  t:id="MatrixEntry"  t:type="text"  t:value="inputValue"/>    



It works fine in 5.0.18. But in 5.1.0.2 snapshot,  I get the following error 
when I submit the form containing the above TextField component.




Could not find a coercion from type java.lang.String to type [Ljava.lang.Double;. Available coercions: Double --> Float, Float --> Double, Long --> Boolean, Long --> Byte, Long --> Double, Long --> Integer, Long --> Short, Number --> Long, Object --> Object[], Object --> String, Object --> java.util.List, Object[] --> java.util.List, String --> Boolean, String --> Double, String --> Long


# org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl.findOrCreateCoercion(TypeCoercerImpl.java:244)
# org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl.access$000(TypeCoercerImpl.java:29)
# org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl$TargetCoercion.getCoercion(TypeCoercerImpl.java:88)
# org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl$TargetCoercion.coerce(TypeCoercerImpl.java:61)
# org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl.coerce(TypeCoercerImpl.java:133)
# $TypeCoercer_1204d5395c9.coerce($TypeCoercer_1204d5395c9.java)
# org.apache.tapestry5.internal.services.TypeCoercedValueEncoderFactory$1.toValue(TypeCoercedValueEncoderFactory.java:45)
# org.apache.tapestry5.corelib.components.Loop.restoreStateFromStoredClientValue(Loop.java:423)
# org.apache.tapestry5.corelib.components.Loop.access$500(Loop.java:41)
# org.apache.tapestry5.corelib.components.Loop$RestoreStateFromStoredClientValue.execute(Loop.java:162)
# org.apache.tapestry5.corelib.components.Loop$RestoreStateFromStoredClientValue.execute(Loop.java:151)
# org.apache.tapestry5.corelib.components.Form.executeStoredActions(Form.java:477)
# org.apache.tapestry5.corelib.components.Form._$advised$onAction(Form.java:375)
# org.apache.tapestry5.corelib.components.Form$onAction$invocation_1204d53cecf.invokeAdvisedMethod(Form$onAction$invocation_1204d53cecf.java)
# org.apache.tapestry5.internal.services.AbstractComponentMethodInvocation.proceed(A



Any assistance to resolve the problem would be very much appreciated!

Shing



      

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: String to Double Type Coercion problem in 5.1.0.2 snapshot

Posted by Howard Lewis Ship <hl...@gmail.com>.
The error reporting could be better, but the coersion there indicates
a Double[], not a double.

On Sat, Mar 28, 2009 at 6:57 AM, Shing Hing Man <ma...@yahoo.com> wrote:
>
> I have a TextField component to input a Double.
>
>
>        @Component(id = "MatrixEntry", parameters ={ "validate=prop:fieldValidator"})
>        private TextField entry;
>
> <INPUT  t:id="MatrixEntry"  t:type="text"  t:value="inputValue"/>
>
>
>
> It works fine in 5.0.18. But in 5.1.0.2 snapshot,  I get the following error
> when I submit the form containing the above TextField component.
>
>
>
>
> Could not find a coercion from type java.lang.String to type [Ljava.lang.Double;. Available coercions: Double --> Float, Float --> Double, Long --> Boolean, Long --> Byte, Long --> Double, Long --> Integer, Long --> Short, Number --> Long, Object --> Object[], Object --> String, Object --> java.util.List, Object[] --> java.util.List, String --> Boolean, String --> Double, String --> Long
>
>
> # org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl.findOrCreateCoercion(TypeCoercerImpl.java:244)
> # org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl.access$000(TypeCoercerImpl.java:29)
> # org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl$TargetCoercion.getCoercion(TypeCoercerImpl.java:88)
> # org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl$TargetCoercion.coerce(TypeCoercerImpl.java:61)
> # org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl.coerce(TypeCoercerImpl.java:133)
> # $TypeCoercer_1204d5395c9.coerce($TypeCoercer_1204d5395c9.java)
> # org.apache.tapestry5.internal.services.TypeCoercedValueEncoderFactory$1.toValue(TypeCoercedValueEncoderFactory.java:45)
> # org.apache.tapestry5.corelib.components.Loop.restoreStateFromStoredClientValue(Loop.java:423)
> # org.apache.tapestry5.corelib.components.Loop.access$500(Loop.java:41)
> # org.apache.tapestry5.corelib.components.Loop$RestoreStateFromStoredClientValue.execute(Loop.java:162)
> # org.apache.tapestry5.corelib.components.Loop$RestoreStateFromStoredClientValue.execute(Loop.java:151)
> # org.apache.tapestry5.corelib.components.Form.executeStoredActions(Form.java:477)
> # org.apache.tapestry5.corelib.components.Form._$advised$onAction(Form.java:375)
> # org.apache.tapestry5.corelib.components.Form$onAction$invocation_1204d53cecf.invokeAdvisedMethod(Form$onAction$invocation_1204d53cecf.java)
> # org.apache.tapestry5.internal.services.AbstractComponentMethodInvocation.proceed(A
>
>
>
> Any assistance to resolve the problem would be very much appreciated!
>
> Shing
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org