You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Juan Isern <ju...@gmail.com> on 2010/05/11 22:24:04 UTC

AJAX version of setupRender()

Hi guys,

I was wondering if there's a "version" of setupRender() that works for AJAX
events too.

It makes sense totally that setupRender() is not executed because no render
takes place... but still I'm unable to find a component cycle method that I
cling to in order to perform some initialization actions (e.g. initialize
stuff, reattach Hibernate objects, etc.)

I think that even if no solution is available natively, the same exact
situation may be achieved by dispatching an second event (like
ComponentActivated) whose handler is executed before the original event's
handler itself. I don't know how to do this in a transparent way, either.

Any ideas on this? Thanks a lot!


-- 
View this message in context: http://old.nabble.com/AJAX-version-of-setupRender%28%29-tp28528961p28528961.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 version of setupRender()

Posted by Juan Isern <ju...@gmail.com>.
Thanks guys!


Thiago H. de Paula Figueiredo wrote:
> 
> On Fri, 14 May 2010 13:04:42 -0300, Geoff Callender  
> <ge...@gmail.com> wrote:
> 
>> Thanks Thiago, that is such a great observation about setupRender()  
>> being invoked in components in a Zone that I will be putting it to use  
>> in the next release of JumpStart. I think you'll like it.
> 
> Cool! :)
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
> 
> ---------------------------------------------------------------------
> 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://old.nabble.com/AJAX-version-of-setupRender%28%29-tp28528961p28570541.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 version of setupRender()

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Fri, 14 May 2010 13:04:42 -0300, Geoff Callender  
<ge...@gmail.com> wrote:

> Thanks Thiago, that is such a great observation about setupRender()  
> being invoked in components in a Zone that I will be putting it to use  
> in the next release of JumpStart. I think you'll like it.

Cool! :)

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: AJAX version of setupRender()

Posted by Howard Lewis Ship <hl...@gmail.com>.
True, but if you look at the implementation, its just a couple of
lines of code that will work under 5.1 as well.

On Fri, May 14, 2010 at 10:11 AM, Inge Solvoll <in...@gmail.com> wrote:
> 5.2 for RenderNotification mixin, I assume?
>
> On Fri, May 14, 2010 at 6:52 PM, Howard Lewis Ship <hl...@gmail.com> wrote:
>
>> I also use the RenderNotification mixin to find out when a component
>> has rendered as part of an Ajax partial update; the event handler can
>> then collection client ids and add JavaScript.
>>
>> On Fri, May 14, 2010 at 9:04 AM, Geoff Callender
>> <ge...@gmail.com> wrote:
>> > Thanks Thiago, that is such a great observation about setupRender() being
>> invoked in components in a Zone that I will be putting it to use in the nextTrue, but
>> release of JumpStart. I think you'll like it.
>> >
>> > Cheers, Geoff
>> >
>> > On 12/05/2010, at 6:31 AM, Thiago H. de Paula Figueiredo wrote:
>> >
>> >> On Tue, 11 May 2010 17:24:04 -0300, Juan Isern <ju...@gmail.com>
>> wrote:
>> >>
>> >>> Hi guys,
>> >>
>> >> Hi!
>> >>
>> >>> I was wondering if there's a "version" of setupRender() that works for
>> AJAX events too.
>> >>
>> >> onActivate() is invoked in any kind of request. You can use
>> ComponentResources.isRendering() to know if it is a rendering request and
>> Request.isXHR() if it an AJAX request.
>> >>
>> >> Another option is to wrap everything inside the Zone in a component. Its
>> setupRender() method will be invoked.
>> >>
>> >> --
>> >> Thiago H. de Paula Figueiredo
>> >> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
>> and instructor
>> >> Owner, Ars Machina Tecnologia da Informação Ltda.
>> >> http://www.arsmachina.com.br
>> >>
>> >> ---------------------------------------------------------------------
>> >> 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
>> >
>> >
>>
>>
>>
>> --
>> Howard M. Lewis Ship
>>
>> Creator of Apache Tapestry
>>
>> The source for Tapestry training, mentoring and support. Contact me to
>> learn how I can get you up and productive in Tapestry fast!
>>
>> (971) 678-5210
>> http://howardlewisship.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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


Re: AJAX version of setupRender()

Posted by Inge Solvoll <in...@gmail.com>.
5.2 for RenderNotification mixin, I assume?

On Fri, May 14, 2010 at 6:52 PM, Howard Lewis Ship <hl...@gmail.com> wrote:

> I also use the RenderNotification mixin to find out when a component
> has rendered as part of an Ajax partial update; the event handler can
> then collection client ids and add JavaScript.
>
> On Fri, May 14, 2010 at 9:04 AM, Geoff Callender
> <ge...@gmail.com> wrote:
> > Thanks Thiago, that is such a great observation about setupRender() being
> invoked in components in a Zone that I will be putting it to use in the next
> release of JumpStart. I think you'll like it.
> >
> > Cheers, Geoff
> >
> > On 12/05/2010, at 6:31 AM, Thiago H. de Paula Figueiredo wrote:
> >
> >> On Tue, 11 May 2010 17:24:04 -0300, Juan Isern <ju...@gmail.com>
> wrote:
> >>
> >>> Hi guys,
> >>
> >> Hi!
> >>
> >>> I was wondering if there's a "version" of setupRender() that works for
> AJAX events too.
> >>
> >> onActivate() is invoked in any kind of request. You can use
> ComponentResources.isRendering() to know if it is a rendering request and
> Request.isXHR() if it an AJAX request.
> >>
> >> Another option is to wrap everything inside the Zone in a component. Its
> setupRender() method will be invoked.
> >>
> >> --
> >> Thiago H. de Paula Figueiredo
> >> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> >> Owner, Ars Machina Tecnologia da Informação Ltda.
> >> http://www.arsmachina.com.br
> >>
> >> ---------------------------------------------------------------------
> >> 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
> >
> >
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator of Apache Tapestry
>
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
>
> (971) 678-5210
> http://howardlewisship.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: AJAX version of setupRender()

Posted by Howard Lewis Ship <hl...@gmail.com>.
I also use the RenderNotification mixin to find out when a component
has rendered as part of an Ajax partial update; the event handler can
then collection client ids and add JavaScript.

On Fri, May 14, 2010 at 9:04 AM, Geoff Callender
<ge...@gmail.com> wrote:
> Thanks Thiago, that is such a great observation about setupRender() being invoked in components in a Zone that I will be putting it to use in the next release of JumpStart. I think you'll like it.
>
> Cheers, Geoff
>
> On 12/05/2010, at 6:31 AM, Thiago H. de Paula Figueiredo wrote:
>
>> On Tue, 11 May 2010 17:24:04 -0300, Juan Isern <ju...@gmail.com> wrote:
>>
>>> Hi guys,
>>
>> Hi!
>>
>>> I was wondering if there's a "version" of setupRender() that works for AJAX events too.
>>
>> onActivate() is invoked in any kind of request. You can use ComponentResources.isRendering() to know if it is a rendering request and Request.isXHR() if it an AJAX request.
>>
>> Another option is to wrap everything inside the Zone in a component. Its setupRender() method will be invoked.
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor
>> Owner, Ars Machina Tecnologia da Informação Ltda.
>> http://www.arsmachina.com.br
>>
>> ---------------------------------------------------------------------
>> 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
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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


Re: AJAX version of setupRender()

Posted by Geoff Callender <ge...@gmail.com>.
Thanks Thiago, that is such a great observation about setupRender() being invoked in components in a Zone that I will be putting it to use in the next release of JumpStart. I think you'll like it.

Cheers, Geoff

On 12/05/2010, at 6:31 AM, Thiago H. de Paula Figueiredo wrote:

> On Tue, 11 May 2010 17:24:04 -0300, Juan Isern <ju...@gmail.com> wrote:
> 
>> Hi guys,
> 
> Hi!
> 
>> I was wondering if there's a "version" of setupRender() that works for AJAX events too.
> 
> onActivate() is invoked in any kind of request. You can use ComponentResources.isRendering() to know if it is a rendering request and Request.isXHR() if it an AJAX request.
> 
> Another option is to wrap everything inside the Zone in a component. Its setupRender() method will be invoked.
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
> 
> ---------------------------------------------------------------------
> 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 version of setupRender()

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 11 May 2010 17:24:04 -0300, Juan Isern <ju...@gmail.com> wrote:

> Hi guys,

Hi!

> I was wondering if there's a "version" of setupRender() that works for  
> AJAX events too.

onActivate() is invoked in any kind of request. You can use  
ComponentResources.isRendering() to know if it is a rendering request and  
Request.isXHR() if it an AJAX request.

Another option is to wrap everything inside the Zone in a component. Its  
setupRender() method will be invoked.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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