On Thu, 12 Nov 2015 22:29:45 -0200, Damon <milim...@gmail.com> wrote:

Hello,

Hi!


Im trying to call a function from my html file.

<div t:type="Loop" t:source="propertyImages" t:value="propertyImage" class="medium-7 medium-centered columns">
    <img src="${getExternalImageLink(propertyImage.imgId)}" />
    <br/>Prop Descr: ${propertyImage.description} <br/>
</div>

it calls::

public Link getExternalImageLink(String imgId) {
       return resources.createEventLink("externalImage", imgId);
    }

public ImageStreamResponse onExternalImage(final String imgid)
{

}

when the function is called all i get is a null value passed into it.

This means getPropertyImage().getImgId() is returning null. Your syntax is correct (getExternalImageLink(propertyImage.imgId)).

I'm not sure why you're using createEventLink() for generating asset URLs, by the way. In addition, its handler is returning a StreamResponse to the src attribute of <img>, which won't work unless you're returning a data: URL, which is definitely not the case here.

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.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