You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by ch_pasha <ch...@yahoo.com> on 2012/09/26 11:50:13 UTC

Updating image inside zone

Hi all, 

I have an image with dynamic content inside zone component (jfreechart
actually). Unfortunately when triggering the zone update image content is
never updated - getter method returning streamresponse is called only once
when the page is first loaded but never again,when zone is updated. Is it an
expected behaviour? How can I make the image populate content each time zone
is updated?





--
View this message in context: http://tapestry.1045711.n5.nabble.com/Updating-image-inside-zone-tp5716498.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: Updating image inside zone

Posted by ch_pasha <ch...@yahoo.com>.
No, I think I solved the problem by adding fake context to the chart
component. 
I think the problem was that browser cached the image with src="someurl"
(because the chart is 
ultimately just an html img. By adding "random" data (our context) to the
url we 
prevent the image from  caching (this is my guess). 



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Updating-image-inside-zone-tp5716498p5716503.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: Updating image inside zone

Posted by Charlouze <me...@charlouze.com>.
Maybe your component jfreechart:jpegchart caches the datas.

2012/9/26 ch_pasha <ch...@yahoo.com>

> Yes I can
>
>
> tml wrote
> > <t:eventlink event="showChart" context="[execution]" zone="chartZone">
> > ${execution.id}
> > </t:eventlink>
> >
> > <t:zone t:id="chartZone" id="chartZone" update="show">
> >
> > <jfreechart:jpegchart t:id="chart" cliendId="chart"
> >                               chart="chart"
> >                               width="850" height="600"/>
> > </t:zone>
>
>
>
> java wrote
> > @InjectComponent
> > private Zone chartZone;
> >
> > @OnEvent(value = "showChart")
> > Object onShowChart(RestwertExecution execution) {
> >     this.execution = execution;
> >     return httpRequest.isXHR() ? chartZone.getBody() : null;
> > }
> >
> >
> > public JFreeChart getChart() {
> >       return new MyChart().generate(dao.loadSomeData());
> > }
>
> As I said, I see that zone is updated (there are also log entries for
> dao.loadSomeData() every time). but the getChart() method is never called
> again and chart content is obviously the same
>
>
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Updating-image-inside-zone-tp5716498p5716500.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: Updating image inside zone

Posted by ch_pasha <ch...@yahoo.com>.
Yes I can


tml wrote
> <t:eventlink event="showChart" context="[execution]" zone="chartZone">
> ${execution.id}
> </t:eventlink>
> 
> <t:zone t:id="chartZone" id="chartZone" update="show">
>         
> <jfreechart:jpegchart t:id="chart" cliendId="chart"
>                               chart="chart"
>                               width="850" height="600"/>
> </t:zone>



java wrote
> @InjectComponent
> private Zone chartZone;
> 
> @OnEvent(value = "showChart")
> Object onShowChart(RestwertExecution execution) {
>     this.execution = execution;
>     return httpRequest.isXHR() ? chartZone.getBody() : null;
> }
> 
> 
> public JFreeChart getChart() {
>       return new MyChart().generate(dao.loadSomeData());
> }

As I said, I see that zone is updated (there are also log entries for
dao.loadSomeData() every time). but the getChart() method is never called
again and chart content is obviously the same




--
View this message in context: http://tapestry.1045711.n5.nabble.com/Updating-image-inside-zone-tp5716498p5716500.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: Updating image inside zone

Posted by Dieter Sauvillers <di...@gmail.com>.
Can you provide the code when performing zone update?

On 26 September 2012 11:50, ch_pasha <ch...@yahoo.com> wrote:
> Hi all,
>
> I have an image with dynamic content inside zone component (jfreechart
> actually). Unfortunately when triggering the zone update image content is
> never updated - getter method returning streamresponse is called only once
> when the page is first loaded but never again,when zone is updated. Is it an
> expected behaviour? How can I make the image populate content each time zone
> is updated?
>
>
>
>
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/Updating-image-inside-zone-tp5716498.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
>

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