You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by bioye <bi...@yahoo.com> on 2008/03/16 23:07:47 UTC

Ajax chart service

I have a service that generates images for using jfreechart.  I want to
convert this service to ajax so that the chart image can load without
reloading the whole page.  I have played around with div's and
updateComponent and ResponseBuilder.  The ajax response seems to be
generated but the image is never updated.  What is the problem?  Do I need
to find a way to include Javascript to load the image via scripting?  My
ajax works for raw text but not for image services.
-- 
View this message in context: http://www.nabble.com/Ajax-chart-service-tp16084794p16084794.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: Ajax chart service

Posted by bioye <bi...@yahoo.com>.
I'm using T4?  Will this work in tapestry 4.1.3.  And if necessary, can you
provide links or sample code on how to handle this in t4?  Thanks.


Davor Hrg wrote:
> 
> you need not ajax here,
> 
> just change src of the image,
> 
> first create an action link that can produce an image
> then use javascript to switch urls for the image...
> 
> http://wiki.apache.org/tapestry/Tapestry5HowToCreatePieChartsInAPage
> 
> Davor Hrg
> 
> On Sun, Mar 16, 2008 at 11:07 PM, bioye <bi...@yahoo.com> wrote:
>>
>>  I have a service that generates images for using jfreechart.  I want to
>>  convert this service to ajax so that the chart image can load without
>>  reloading the whole page.  I have played around with div's and
>>  updateComponent and ResponseBuilder.  The ajax response seems to be
>>  generated but the image is never updated.  What is the problem?  Do I
>> need
>>  to find a way to include Javascript to load the image via scripting?  My
>>  ajax works for raw text but not for image services.
>>  --
>>  View this message in context:
>> http://www.nabble.com/Ajax-chart-service-tp16084794p16084794.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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Ajax-chart-service-tp16084794p16085295.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: Ajax chart service

Posted by Davor Hrg <hr...@gmail.com>.
you need not ajax here,

just change src of the image,

first create an action link that can produce an image
then use javascript to switch urls for the image...

http://wiki.apache.org/tapestry/Tapestry5HowToCreatePieChartsInAPage

Davor Hrg

On Sun, Mar 16, 2008 at 11:07 PM, bioye <bi...@yahoo.com> wrote:
>
>  I have a service that generates images for using jfreechart.  I want to
>  convert this service to ajax so that the chart image can load without
>  reloading the whole page.  I have played around with div's and
>  updateComponent and ResponseBuilder.  The ajax response seems to be
>  generated but the image is never updated.  What is the problem?  Do I need
>  to find a way to include Javascript to load the image via scripting?  My
>  ajax works for raw text but not for image services.
>  --
>  View this message in context: http://www.nabble.com/Ajax-chart-service-tp16084794p16084794.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


Re: Ajax chart service

Posted by Renat Zubairov <re...@gmail.com>.
IMHO you don't need AJAX for that, becuase AJAX require XML HTTP Request to
client, you don't really need to do that in case you know how your image URL
should looks like. For example if you implementing a zooming functionality
you just need a javascrtip to select an area of the image, then you
calculate (in javascript) coordinate of rendered graph (as subsect of
original image) and just replace the image's URL inside javascript. That's
all, browser will make a request to the server and refreshes the
image.Basically
it's something like

document.getElementById('im').src='img1.jpg'


I'm sure you will find a good replacement in Prototype for "
document.getElement...".

Renat

On 16/03/2008, bioye <bi...@yahoo.com> wrote:
>
>
> I have a service that generates images for using jfreechart.  I want to
> convert this service to ajax so that the chart image can load without
> reloading the whole page.  I have played around with div's and
> updateComponent and ResponseBuilder.  The ajax response seems to be
> generated but the image is never updated.  What is the problem?  Do I need
> to find a way to include Javascript to load the image via scripting?  My
> ajax works for raw text but not for image services.
>
> --
> View this message in context:
> http://www.nabble.com/Ajax-chart-service-tp16084794p16084794.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
>
>


-- 
Best regards,
Renat Zubairov