You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Bob Harner <bo...@gmail.com> on 2012/08/03 01:00:28 UTC

Re: component parameter coercion

You can contribute a type coercion, as described at
http://tapestry.apache.org/typecoercer-service.html
On Aug 2, 2012 3:49 AM, "Angelo C." <an...@gmail.com> wrote:

> hi,
>
> trying to pass a literal to a component hoping it can do a coercion, here
> is
> the code:
>
> public class IfGroup {
>         @Parameter(required = true)
>         private Group context;
>
>         Object beginRender() {
>         }
> }
>
> this works as 'tesGroup' is a property in the page:
>
> <t:ifgroup context="testGroup">
>    <p>hello</p>
> </t:ifgroup>
>
> but this one will not:
>
> <t:ifgroup context="12">
>    <p>hello</p>
> </t:ifgroup>
>
>
> Could not find a coercion from type java.lang.String to type
> org.sample.entities.Group.
>
> How to make this work? Thanks,
>
> Angelo
>
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/component-parameter-coercion-tp5714988.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>