You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Piero Sartini <li...@pierosartini.de> on 2009/06/19 12:29:45 UTC

RenderSupport in pages?

Is it possible to get the RenderSupport in pages? I need to add some 
stylesheet...

What works is to extend my Page from some Component... but I am not sure that 
is the way to go?!

	Piero

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


Re: RenderSupport in pages?

Posted by Piero Sartini <li...@pierosartini.de>.
> What Tapestry version are you using?

5.1.0.5



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


Re: RenderSupport in pages?

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
What Tapestry version are you using?

-- 
Thiago

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


Re: RenderSupport in pages?

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Fri, Jun 19, 2009 at 7:29 AM, Piero Sartini<li...@pierosartini.de> wrote:
> Is it possible to get the RenderSupport in pages? I need to add some
> stylesheet...

You can @Inject it directly.
By the way, in Tapestry 5, a page is a component and the differences
between them are minimal.

-- 
Thiago

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


Re: RenderSupport in pages?

Posted by Howard Lewis Ship <hl...@gmail.com>.
The fact that you can @Inject RenderSupport as well as use @Environmental is
something explicitly set up in TapestryModule, to allow non-components
access to RenderSupport. The service's implementation simply gets the
RenderSupport from the Environment and delegates all method invocations to
it.



On Fri, Jun 19, 2009 at 9:41 AM, Piero Sartini <li...@pierosartini.de>wrote:

> > You don't have access to the RenderSupport environmental until the page
> is
> > actually rendering. So it's available between the setupRender and
> > cleanupRender phases, but outside of that (i.e in your
> > pageAttached/pageDetached phases) it has not been placed in the
> environment
> > yet.
>
> This clears things up, thanks a lot!
>
>        Piero
>
> ---------------------------------------------------------------------
> 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
Director of Open Source Technology at Formos

Re: RenderSupport in pages?

Posted by Piero Sartini <li...@pierosartini.de>.
> You don't have access to the RenderSupport environmental until the page is
> actually rendering. So it's available between the setupRender and
> cleanupRender phases, but outside of that (i.e in your
> pageAttached/pageDetached phases) it has not been placed in the environment
> yet.

This clears things up, thanks a lot!

	Piero

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


Re: RenderSupport in pages?

Posted by Peter Stavrinides <P....@albourne.com>.
> You don't have access to the RenderSupport environmental until the page is
> actually rendering. So it's available between the setupRender and
> cleanupRender phases, but outside of that (i.e in your
> pageAttached/pageDetached phases) it has not been placed in the environment
> yet.
Yes that makes sense now, thanks Ciaran!

----- Original Message -----
From: "Ciaran Wood" <ci...@gamesys.co.uk>
To: "Tapestry users" <us...@tapestry.apache.org>
Sent: Friday, 19 June, 2009 17:23:28 GMT +02:00 Athens, Beirut, Bucharest, Istanbul
Subject: Re: RenderSupport in pages?

You don't have access to the RenderSupport environmental until the page is
actually rendering. So it's available between the setupRender and
cleanupRender phases, but outside of that (i.e in your
pageAttached/pageDetached phases) it has not been placed in the environment
yet.

Ciaran


On 19/06/2009 12:27pm, "Piero Sartini" <li...@pierosartini.de> wrote:

> Am Freitag, 19. Juni 2009 13:12:02 schrieb DH:
>> I am sure that exception comes out in ajax request, right? RenderSupport is
>> not available in ajax request.
> 
> Nope.. as soon as I try to access the RenderSupport in pageAttached or
> pageLoaded. It is an abstract class - but that shouldn't matter?
> 
> The Page has some AJAX event handlers as well.. maybe that's the problem? I
> now ended up creating a helper component called RenderMyStyle which is
> included in the template.
> 
> That works... but is not very elegant imho.
> 
> Piero
> 
> ---------------------------------------------------------------------
> 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


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


Re: RenderSupport in pages?

Posted by Ciaran Wood <ci...@gamesys.co.uk>.
You don't have access to the RenderSupport environmental until the page is
actually rendering. So it's available between the setupRender and
cleanupRender phases, but outside of that (i.e in your
pageAttached/pageDetached phases) it has not been placed in the environment
yet.

Ciaran


On 19/06/2009 12:27pm, "Piero Sartini" <li...@pierosartini.de> wrote:

> Am Freitag, 19. Juni 2009 13:12:02 schrieb DH:
>> I am sure that exception comes out in ajax request, right? RenderSupport is
>> not available in ajax request.
> 
> Nope.. as soon as I try to access the RenderSupport in pageAttached or
> pageLoaded. It is an abstract class - but that shouldn't matter?
> 
> The Page has some AJAX event handlers as well.. maybe that's the problem? I
> now ended up creating a helper component called RenderMyStyle which is
> included in the template.
> 
> That works... but is not very elegant imho.
> 
> Piero
> 
> ---------------------------------------------------------------------
> 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: RenderSupport in pages?

Posted by Piero Sartini <li...@pierosartini.de>.
Am Freitag, 19. Juni 2009 13:12:02 schrieb DH:
> I am sure that exception comes out in ajax request, right? RenderSupport is
> not available in ajax request.

Nope.. as soon as I try to access the RenderSupport in pageAttached or 
pageLoaded. It is an abstract class - but that shouldn't matter?

The Page has some AJAX event handlers as well.. maybe that's the problem? I 
now ended up creating a helper component called RenderMyStyle which is 
included in the template.

That works... but is not very elegant imho.

	Piero

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


Re: RenderSupport in pages?

Posted by DH <ni...@gmail.com>.
I am sure that exception comes out in ajax request, right? RenderSupport is not available in ajax request.

DH
http://www.gaonline.com.cn

----- Original Message ----- 
From: "Piero Sartini" 
To: "Tapestry users" <us...@tapestry.apache.org>
Sent: Friday, June 19, 2009 7:03 PM
Subject: Re: RenderSupport in pages?


> Am Freitag, 19. Juni 2009 12:43:23 schrieb DH:
>> sure, you can use directly in page.
>>
>> @Environmental
>> private RenderSupport renderSupport;
>>
>> Why to extend page from component, page itself is the top root component.
> 
> Ups - that was too early. It does not work:
> 
> "No object of type org.apache.tapestry5.RenderSupport is available from the 
> Environment"
> 
> Piero
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
>

Re: RenderSupport in pages?

Posted by Piero Sartini <li...@pierosartini.de>.
Am Freitag, 19. Juni 2009 12:43:23 schrieb DH:
> sure, you can use directly in page.
>
> @Environmental
> private RenderSupport renderSupport;
>
> Why to extend page from component, page itself is the top root component.

Ups - that was too early. It does not work:

"No object of type org.apache.tapestry5.RenderSupport is available from the 
Environment"

	Piero

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


Re: RenderSupport in pages?

Posted by Piero Sartini <li...@pierosartini.de>.
Am Freitag, 19. Juni 2009 12:43:23 schrieb DH:
> @Environmental
> private RenderSupport renderSupport;

I tried it using @Inject like in the components. @Environmental works :-)
Thanks! 

	Piero

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


Re: RenderSupport in pages?

Posted by DH <ni...@gmail.com>.
sure, you can use directly in page.

@Environmental
private RenderSupport renderSupport;

Why to extend page from component, page itself is the top root component.

DH
http://www.gaonline.com.cn

----- Original Message ----- 
From: "Piero Sartini" 
To: "Tapestry users" <us...@tapestry.apache.org>
Sent: Friday, June 19, 2009 6:29 PM
Subject: RenderSupport in pages?


> Is it possible to get the RenderSupport in pages? I need to add some 
> stylesheet...
> 
> What works is to extend my Page from some Component... but I am not sure that 
> is the way to go?!
> 
> Piero
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
>