[
https://issues.apache.org/jira/browse/TAP5-731?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12797318#action_12797318
]
Howard M. Lewis Ship commented on TAP5-731:
-------------------------------------------
Not a fan of this approach: tieing the behavior of the component to the tag it
renders, it feels like a very backdoor way to accomplish things.
Also, why is your page generating the image?
When I generate dynamic images, I route it as follows:
<img src="${imageURL}" ..>
public Link getImageURL() { return resources.createEventLink("drawImage"); }
public StreamResponse onDrawImage() { .... }
> PageLink should fill src rather than href on img tags
> -----------------------------------------------------
>
> Key: TAP5-731
> URL: https://issues.apache.org/jira/browse/TAP5-731
> Project: Tapestry 5
> Issue Type: Improvement
> Affects Versions: 5.1.0.0, 5.1.0.1, 5.1.0.2, 5.1.0.3, 5.1.0.4, 5.1.0.5,
> 5.0.15, 5.0.16, 5.0.17, 5.0.18
> Reporter: Andy Buckley
> Priority: Minor
>
> If I use a PageLink as hidden markup on a normal <a> link, the href attribute
> is replaced as expected:
> <!-- Link to a generated image -->
> <a href="#" t:type="pagelink" t:page="plotimage"
> t:context="imagename">foo</a>
> produces
> <a href="/plotimage/my-image-a-b-c.png">foo</a>
> It would be nice to use the same simple idiom for producing generated inline
> images, e.g.
> <img src="#" t:type="pagelink" t:page="plotimage"
> t:context="imagename" />
> However, rather than fill the "src" attribute, Tapestry adds an unused href
> again:
> <img src="#" href="/plotimage/my-image-a-b-c.png"/>
> It would be good if PageLink would treat <img> tags differently from other
> tags and fill the "src" attribute, so that the bulky workaround with injected
> ComponentResources being used to create an ActionLink isn't necessary.
> I *think* <img> is the only HTML tag with a name other than "href" for URLs,
> but if not then please treat this as being a request that PageLink should
> fill the appropriate URL attribute on any tag it's attached to.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.