You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Alexandru Dragomir <al...@gmail.com> on 2007/01/07 20:53:09 UTC

ajax components rendering behavior

Hi !

I have 2 components on a page :  a chart (A) and a form containing details
about the chart (B).
They both communicate through ajax.

On pressing a link on A , B gets filled in with the details.
On submiting the form (B) , A gets refreshed(a new chart is generated
reflecting the modifications from the form).

Pressing the link on A is infact calling
tapestry.linkOnClick('
http://localhost:8080/MyPage,B.sdirect?updateParts=B&objectId=732921506','B',false)
};

I see that along with the initialization script of B is also called the
initialization script of A.
Also , the A gets rerendered : methods like pageBeginRender ,
prepareForRender (in which i'm doing the generation of the chart) are called
on component A.

The re execution of script is not of so much trouble as the rerendering of
component A ( since the chart is regenerated, even is not needed to be
refreshed).

Is this the expected behavior or i'm doing something wrong ?

Thanks,
Alex

Re: ajax components rendering behavior

Posted by Alexandru Dragomir <al...@gmail.com>.
Perhaps not the best solution  but it works :
I added a flag in an ASO object which controls whether that piece of code
i'm interested in should be executed or not.

Cheers ,
Alex

On 1/7/07, Norbert Sándor <de...@erinors.com> wrote:
>
> I think it's normal because in case of your ajax request the entire page
> is rendered on the server, although just some parts of it are refreshed
> on the client.
>
> Shoot me if I'm wrong :)
>
> Regards:
> Norbi
>
> Alexandru Dragomir írta:
> > The script of A is called because is executed in the prepareForRender
> > method.
> >
> > So , i rephrase my question to : Is it the normal behavior that the
> > method
> > prepareForRender of component A (the calling component) is called when
> > B is
> > requested to refresh ?
> >
> > Thanks  a lot !
> > Alex
> >
> > On 1/7/07, Alexandru Dragomir <al...@gmail.com> wrote:
> >>
> >> Hi !
> >>
> >> I have 2 components on a page :  a chart (A) and a form containing
> >> details
> >> about the chart (B).
> >> They both communicate through ajax.
> >>
> >> On pressing a link on A , B gets filled in with the details.
> >> On submiting the form (B) , A gets refreshed(a new chart is generated
> >> reflecting the modifications from the form).
> >>
> >> Pressing the link on A is infact calling
> >> tapestry.linkOnClick('
> http://localhost:8080/MyPage,B.sdirect?updateParts=B&objectId=732921506','B',false)
> <
> http://localhost:8080/MyPage,B.sdirect?updateParts=B&objectId=732921506%27,%27B%27,false%29
> >
> >>
> >> };
> >>
> >> I see that along with the initialization script of B is also called the
> >> initialization script of A.
> >> Also , the A gets rerendered : methods like pageBeginRender ,
> >> prepareForRender (in which i'm doing the generation of the chart) are
> >> called
> >> on component A.
> >>
> >> The re execution of script is not of so much trouble as the
> >> rerendering of
> >> component A ( since the chart is regenerated, even is not needed to be
> >> refreshed).
> >>
> >> Is this the expected behavior or i'm doing something wrong ?
> >>
> >> Thanks,
> >> Alex
> >>
> >>
> >
> > ------------------------------------------------------------------------
> >
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.5.432 / Virus Database: 268.16.7/618 - Release Date:
> 2007.01.06. 19:47
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: ajax components rendering behavior

Posted by Norbert Sándor <de...@erinors.com>.
I think it's normal because in case of your ajax request the entire page 
is rendered on the server, although just some parts of it are refreshed 
on the client.

Shoot me if I'm wrong :)

Regards:
Norbi

Alexandru Dragomir írta:
> The script of A is called because is executed in the prepareForRender
> method.
>
> So , i rephrase my question to : Is it the normal behavior that the 
> method
> prepareForRender of component A (the calling component) is called when 
> B is
> requested to refresh ?
>
> Thanks  a lot !
> Alex
>
> On 1/7/07, Alexandru Dragomir <al...@gmail.com> wrote:
>>
>> Hi !
>>
>> I have 2 components on a page :  a chart (A) and a form containing 
>> details
>> about the chart (B).
>> They both communicate through ajax.
>>
>> On pressing a link on A , B gets filled in with the details.
>> On submiting the form (B) , A gets refreshed(a new chart is generated
>> reflecting the modifications from the form).
>>
>> Pressing the link on A is infact calling
>> tapestry.linkOnClick('http://localhost:8080/MyPage,B.sdirect?updateParts=B&objectId=732921506','B',false)<http://localhost:8080/MyPage,B.sdirect?updateParts=B&objectId=732921506%27,%27B%27,false%29> 
>>
>> };
>>
>> I see that along with the initialization script of B is also called the
>> initialization script of A.
>> Also , the A gets rerendered : methods like pageBeginRender ,
>> prepareForRender (in which i'm doing the generation of the chart) are 
>> called
>> on component A.
>>
>> The re execution of script is not of so much trouble as the 
>> rerendering of
>> component A ( since the chart is regenerated, even is not needed to be
>> refreshed).
>>
>> Is this the expected behavior or i'm doing something wrong ?
>>
>> Thanks,
>> Alex
>>
>>
>
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.432 / Virus Database: 268.16.7/618 - Release Date: 2007.01.06. 19:47
>   

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


Re: ajax components rendering behavior

Posted by Alexandru Dragomir <al...@gmail.com>.
The script of A is called because is executed in the prepareForRender
method.

So , i rephrase my question to : Is it the normal behavior that the method
prepareForRender of component A (the calling component) is called when B is
requested to refresh ?

Thanks  a lot !
Alex

On 1/7/07, Alexandru Dragomir <al...@gmail.com> wrote:
>
> Hi !
>
> I have 2 components on a page :  a chart (A) and a form containing details
> about the chart (B).
> They both communicate through ajax.
>
> On pressing a link on A , B gets filled in with the details.
> On submiting the form (B) , A gets refreshed(a new chart is generated
> reflecting the modifications from the form).
>
> Pressing the link on A is infact calling
> tapestry.linkOnClick('http://localhost:8080/MyPage,B.sdirect?updateParts=B&objectId=732921506','B',false)<http://localhost:8080/MyPage,B.sdirect?updateParts=B&objectId=732921506%27,%27B%27,false%29>
> };
>
> I see that along with the initialization script of B is also called the
> initialization script of A.
> Also , the A gets rerendered : methods like pageBeginRender ,
> prepareForRender (in which i'm doing the generation of the chart) are called
> on component A.
>
> The re execution of script is not of so much trouble as the rerendering of
> component A ( since the chart is regenerated, even is not needed to be
> refreshed).
>
> Is this the expected behavior or i'm doing something wrong ?
>
> Thanks,
> Alex
>
>