On Mon, 08 Nov 2010 09:12:23 -0200, Gunnar Eketrapp <gunnar.eketr...@gmail.com> wrote:

I have a layout component to which I would like to pass an asset (a banner image) as a parameter.

But I get this error ...

Could not find a coercion from type java.lang.String to type
org.apache.tapestry5.Asset.

Layout.java
...
   @Parameter(required = false)
    private Asset banner;
...

<html t:type="layout" t:banner="${context:images/banner_index.jpg}"
      xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
      xmlns:p="tapestry:parameter">

Try t:banner="context:images/banner_index.jpg". Using ${} forces the coercion of the value to String. By the way, don't use expansions when passing parameters.

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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

Reply via email to