You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Andy Buckley <an...@durham.ac.uk> on 2009/06/01 17:04:48 UTC

T5: PageLink on img tag

Hi,

I'm doing some data rendering using JFreeChart, for which I've created a
Tapestry page "PlotImage" which renders images and returns them as
StreamResponses of type PNG or PDF. I'd like to use this to render
inline <img> tags, e.g.:

<a href="#" t:type="pagelink" t:page="plotimage"
t:context="literal:hepdata-p7521-d2-x1-y1_600.png">
  <img src="#" t:type="pagelink" t:page="plotimage"
t:context="literal:hepdata-p7521-d2-x1-y1_300.png" />
</a>

(only without the "literal:" bits in practice: these contexts will be
generated dynamically). The result isn't quite right, though: the <a>
link to the full-size image functions just fine, but the pagelinked
<img> renders the pagelink as an "href" tag... not very useful: I'd
hoped that there would be special PageLink treatment for <img> tags that
would use the "src" attribute rather than "href". So, *is* there a nice
way to dynamically create <img> src attributes pointing to Tapestry pages?

Thanks,
Andy

-- 
Dr Andy Buckley
Institute for Particle Physics Phenomenology
Durham University
0191 3343798 | 0191 3732613 | www.insectnation.org

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


Re: T5: PageLink on img tag

Posted by Daniel Jones <da...@murieston.com>.
Hi Andy,

Have a look at this thread, I posted a solution that is similar to your
requirements.

http://www.nabble.com/T5:-How-to-load-image-Asset-from-filesystem--td22433419i20.html
http://www.nabble.com/T5:-How-to-load-image-Asset-from-filesystem--td22433419i20.html 

Hope this helps,
Daniel
-- 
View this message in context: http://www.nabble.com/T5%3A-PageLink-on-img-tag-tp23816479p23818191.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


Re: T5: PageLink on img tag

Posted by Andy Buckley <an...@durham.ac.uk>.
Thiago H. de Paula Figueiredo wrote:
> Em Mon, 01 Jun 2009 12:04:48 -0300, Andy Buckley
> <an...@durham.ac.uk> escreveu:
> 
>> Hi,
> 
> Hi!
> 
>> (only without the "literal:" bits in practice: these contexts will be
>> generated dynamically). The result isn't quite right, though: the <a>
>> link to the full-size image functions just fine, but the pagelinked
>> <img> renders the pagelink as an "href" tag... not very useful: I'd
>> hoped that there would be special PageLink treatment for <img> tags that
>> would use the "src" attribute rather than "href".
> 
> What you're asking is very reasonable, IMHO. Please post a JIRA about it.

Done:

https://issues.apache.org/jira/browse/TAP5-731

Thanks,
Andy

-- 
Dr Andy Buckley
Institute for Particle Physics Phenomenology
Durham University
0191 3343798 | 0191 3732613 | www.insectnation.org

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


Re: T5: PageLink on img tag

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Mon, 01 Jun 2009 12:04:48 -0300, Andy Buckley  
<an...@durham.ac.uk> escreveu:

> Hi,

Hi!

> (only without the "literal:" bits in practice: these contexts will be
> generated dynamically). The result isn't quite right, though: the <a>
> link to the full-size image functions just fine, but the pagelinked
> <img> renders the pagelink as an "href" tag... not very useful: I'd
> hoped that there would be special PageLink treatment for <img> tags that
> would use the "src" attribute rather than "href".

What you're asking is very reasonable, IMHO. Please post a JIRA about it.
In the mean time, you can generate the URL injecting the  
PageRenderLinkSource service and invoking  
createPageRenderLinkWithContext(Class, Object[]).

-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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


Re: T5: PageLink on img tag

Posted by Kalle Korhonen <ka...@gmail.com>.
Incidentally, I'm doing exactly the same. Rather than trying to use a
a page link, I'm just creating an action link then sticking the value
to img tag's src attribute (as described at
http://wiki.apache.org/tapestry/Tapestry5HowToCreatePieChartsInAPage).
This works fine for me.

Kalle

On Mon, Jun 1, 2009 at 8:04 AM, Andy Buckley <an...@durham.ac.uk> wrote:
> Hi,
>
> I'm doing some data rendering using JFreeChart, for which I've created a
> Tapestry page "PlotImage" which renders images and returns them as
> StreamResponses of type PNG or PDF. I'd like to use this to render
> inline <img> tags, e.g.:
>
> <a href="#" t:type="pagelink" t:page="plotimage"
> t:context="literal:hepdata-p7521-d2-x1-y1_600.png">
>  <img src="#" t:type="pagelink" t:page="plotimage"
> t:context="literal:hepdata-p7521-d2-x1-y1_300.png" />
> </a>
>
> (only without the "literal:" bits in practice: these contexts will be
> generated dynamically). The result isn't quite right, though: the <a>
> link to the full-size image functions just fine, but the pagelinked
> <img> renders the pagelink as an "href" tag... not very useful: I'd
> hoped that there would be special PageLink treatment for <img> tags that
> would use the "src" attribute rather than "href". So, *is* there a nice
> way to dynamically create <img> src attributes pointing to Tapestry pages?
>
> Thanks,
> Andy
>
> --
> Dr Andy Buckley
> Institute for Particle Physics Phenomenology
> Durham University
> 0191 3343798 | 0191 3732613 | www.insectnation.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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