Re: RenderSupport in pages?

2009-06-19 Thread Howard Lewis Ship
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 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-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Howard M. Lewis Ship

Creator of Apache Tapestry
Director of Open Source Technology at Formos


Re: RenderSupport in pages?

2009-06-19 Thread Piero Sartini
> 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-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: RenderSupport in pages?

2009-06-19 Thread Thiago H. de Paula Figueiredo
On Fri, Jun 19, 2009 at 12:46 PM,  wrote:
>> A page *is* a component, so there's no conflict here. I guess the
>> documentation is trying to say that the Environmental annotation does
>> not work in services.
> Yes Thiago, but this is not what it is actually saying is it? How would a new 
> user catch this?

I think this needs a documentation improvement JIRA.

-- 
Thiago

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



Re: RenderSupport in pages?

2009-06-19 Thread Peter Stavrinides

> That's not true for @PageLoaded that's where you put "one-time
> component initializations that can't be done at instantance
> initialzation time"

Yes I see that I have missed that.

- Original Message -
From: "Massimo Lusetti" 
To: "Tapestry users" 
Sent: Friday, 19 June, 2009 18:53:19 GMT +02:00 Athens, Beirut, Bucharest, 
Istanbul
Subject: Re: RenderSupport in pages?

On Fri, Jun 19, 2009 at 5:46 PM,  wrote:

>
> > Request != render. A request can have rendering, but their not the same.
> Yes of course, I was talking about the scope of the service "Environmental 
> services are, by their nature, per-thread (and therefore per-request).", so 
> are @PageAttached and @PageLoaded triggered on every Request.

That's not true for @PageLoaded that's where you put "one-time
component initializations that can't be done at instantance
initialzation time"

Cheers
--
Massimo
http://meridio.blogspot.com

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


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



Re: RenderSupport in pages?

2009-06-19 Thread Massimo Lusetti
On Fri, Jun 19, 2009 at 5:46 PM,  wrote:

>
> > Request != render. A request can have rendering, but their not the same.
> Yes of course, I was talking about the scope of the service "Environmental 
> services are, by their nature, per-thread (and therefore per-request).", so 
> are @PageAttached and @PageLoaded triggered on every Request.

That's not true for @PageLoaded that's where you put "one-time
component initializations that can't be done at instantance
initialzation time"

Cheers
--
Massimo
http://meridio.blogspot.com

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



Re: RenderSupport in pages?

2009-06-19 Thread P . Stavrinides
> Request != render. A request can have rendering, but their not the same.
Yes of course, I was talking about the scope of the service "Environmental 
services are, by their nature, per-thread (and therefore per-request).", so are 
@PageAttached and @PageLoaded triggered on every Request.

> A page *is* a component, so there's no conflict here. I guess the
> documentation is trying to say that the Environmental annotation does
> not work in services.
Yes Thiago, but this is not what it is actually saying is it? How would a new 
user catch this?


- Original Message -
From: "Thiago H. de Paula Figueiredo" 
To: "Tapestry users" 
Sent: Friday, 19 June, 2009 18:00:59 GMT +02:00 Athens, Beirut, Bucharest, 
Istanbul
Subject: Re: RenderSupport in pages?

On Fri, Jun 19, 2009 at 11:42 AM,  wrote:
> In this case it seems that Tapestry doesn't like it when you use @PageLoaded 
> or @PageAttached, though I can't explain why this wouldn't work...

Not exactly. @PageLoaded and @PageAttached are triggered before
rendering, and RenderSupport is only available while rendering. A
better event for what you want would be @BeforeRender.

> No, not at all I have done this too. I don't know what to make of the docs, 
> they seem a bit conflicting: "The Environmental annotation only works inside
> components." well this is not true, I am using it in pages without problems.

A page *is* a component, so there's no conflict here. I guess the
documentation is trying to say that the Environmental annotation does
not work in services.

> @Environmental works per request, and so does @PageAttached and @PageLoaded, 
> so it is a bit of a puzzle... although these are not really the render
> phase methods with which RenderSupport is best suited for.

Request != render. A request can have rendering, but their not the same.

-- 
Thiago

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


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



Re: RenderSupport in pages?

2009-06-19 Thread Thiago H. de Paula Figueiredo
On Fri, Jun 19, 2009 at 11:42 AM,  wrote:
> In this case it seems that Tapestry doesn't like it when you use @PageLoaded 
> or @PageAttached, though I can't explain why this wouldn't work...

Not exactly. @PageLoaded and @PageAttached are triggered before
rendering, and RenderSupport is only available while rendering. A
better event for what you want would be @BeforeRender.

> No, not at all I have done this too. I don't know what to make of the docs, 
> they seem a bit conflicting: "The Environmental annotation only works inside
> components." well this is not true, I am using it in pages without problems.

A page *is* a component, so there's no conflict here. I guess the
documentation is trying to say that the Environmental annotation does
not work in services.

> @Environmental works per request, and so does @PageAttached and @PageLoaded, 
> so it is a bit of a puzzle... although these are not really the render
> phase methods with which RenderSupport is best suited for.

Request != render. A request can have rendering, but their not the same.

-- 
Thiago

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



Re: RenderSupport in pages?

2009-06-19 Thread Peter Stavrinides
> 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" 
To: "Tapestry users" 
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"  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-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 


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


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



Re: RenderSupport in pages?

2009-06-19 Thread P . Stavrinides
Hi Piero

In this case it seems that Tapestry doesn't like it when you use @PageLoaded or 
@PageAttached, though I can't explain why this wouldn't work... 
> It is an abstract class - but that shouldn't matter?
No, not at all I have done this too. I don't know what to make of the docs, 
they seem a bit conflicting: "The Environmental annotation only works inside 
components." well this is not true, I am using it in pages without problems. 

@Environmental works per request, and so does @PageAttached and @PageLoaded, so 
it is a bit of a puzzle... although these are not really the render phase 
methods with which RenderSupport is best suited for.

regards,
Peter

- Original Message -
From: "Piero Sartini" 
To: "Tapestry users" 
Sent: Friday, 19 June, 2009 14:27:59 GMT +02:00 Athens, Beirut, Bucharest, 
Istanbul
Subject: Re: RenderSupport in pages?

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-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org


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



Re: RenderSupport in pages?

2009-06-19 Thread Ciaran Wood
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"  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-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 


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



Re: RenderSupport in pages?

2009-06-19 Thread Piero Sartini
> What Tapestry version are you using?

5.1.0.5



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



Re: RenderSupport in pages?

2009-06-19 Thread Thiago H. de Paula Figueiredo
What Tapestry version are you using?

-- 
Thiago

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



Re: RenderSupport in pages?

2009-06-19 Thread Thiago H. de Paula Figueiredo
On Fri, Jun 19, 2009 at 7:29 AM, Piero Sartini 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-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: RenderSupport in pages?

2009-06-19 Thread Piero Sartini
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-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: RenderSupport in pages?

2009-06-19 Thread DH
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" 
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-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 
>

Re: RenderSupport in pages?

2009-06-19 Thread Piero Sartini
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-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: RenderSupport in pages?

2009-06-19 Thread Piero Sartini
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-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: RenderSupport in pages?

2009-06-19 Thread 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.

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

- Original Message - 
From: "Piero Sartini" 
To: "Tapestry users" 
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-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 
>

RenderSupport in pages?

2009-06-19 Thread Piero Sartini
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-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org