Re: @Environment problem

2008-07-23 Thread Kristian Marinkovic
hi chris,

the DocumentLinker is a service is a service that is only
accessible via the RenderSupport service and therefore
suffers the same problem

see TapestryModule:

public void contributeMarkupRenderer(...)
{

MarkupRendererFilter pageRenderSupport = new MarkupRendererFilter()
{
public void renderMarkup(MarkupWriter writer, MarkupRenderer renderer)
{
DocumentLinkerImpl linker = new 
DocumentLinkerImpl(productionMode);

RenderSupportImpl support = new RenderSupportImpl(linker, 
symbolSource, assetSource,

g,
kris





Chris Lewis <[EMAIL PROTECTED]> 
23.07.2008 13:11
Bitte antworten an
"Tapestry users" 


An
Tapestry users 
Kopie

Thema
Re: @Environment problem






Petros,

Instead of RenderSupport, try DocumentLinker. It should be available in
such cases, the only issue is that it's internal. I don't remember if
the "rules" are not to use internal services at all, or simply not to
extend them.

chris

Petros Petrou wrote:
> Thanks Kris/Sven, 
>
> The version I am using is 5.0.13. 
>
> Kris, if I am understanding your explanation correctly this means I have 
no
> way of using this code
> renderSupport.addScript("%s.show%s(%s);", window1.getClientId(), 
isCenter()
> ? "Center" : "", isModal()); 
> within an action method ?
>
> PS: This is my original issue
> http://www.nabble.com/t5components---Window-to18087605.html 
> Sorry if I complicated things by creating two different issues. 
> Sven, sorry about all these questions but my Javascript skills are very
> limited.
>
>
> Petros
> 
>
>
> kristian.marinkovic wrote:
> 
>> the RenderSupport service is only available during
>> the render phase (page rendering)
>>
>> you are trying to access it during the component event
>> phase 
>>
>> (i hope i used the correct terms :))
>>
>> g,
>> kris
>>
>>
>>
>>
>> "Sven Homburg" <[EMAIL PROTECTED]> 
>> 22.07.2008 14:44
>> Bitte antworten an
>> "Tapestry users" 
>>
>>
>> An
>> "Tapestry users" 
>> Kopie
>>
>> Thema
>> Re: @Environment problem
>>
>>
>>
>>
>>
>>
>> wich version of tapestry are you using (5.0.??)
>>
>> 2008/7/22 Petros Petrou <[EMAIL PROTECTED]>:
>>
>> 
>>> I have the following code
>>>
>>> Test.java
>>>@Environmental
>>>private RenderSupport renderSupport;
>>>
>>>   @OnEvent(value = "action", component = "openWindowActionLink")
>>>void onActionFromOpenWindowActionLink()
>>>{
>>>renderSupport.getClass();
>>>}
>>>
>>> Test.tml
>>> Open Window
>>>
>>>
>>> When the Open Window link is clicked I am getting the following 
>>> 
>> exception
>> 
>>> No object of type org.apache.tapestry5.RenderSupport is available from 

>>> 
>> the
>> 
>>> Environment. Available types are
>>> org.apache.tapestry5.services.ComponentEventResultProcessor.
>>>
>>> Does anyone know how I can even approach this problem.
>>>
>>> Petros
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/%40Environment-problem-tp18587443p18587443.html
>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>> 
>> -- 
>> with regards
>> Sven Homburg
>> http://tapestry5-components.googlecode.com
>> http://chenillekit.googlecode.com
>>
>>
>>
>> 
>
> 

-- 
http://thegodcode.net




Re: @Environment problem

2008-07-23 Thread Chris Lewis
Petros,

Instead of RenderSupport, try DocumentLinker. It should be available in
such cases, the only issue is that it's internal. I don't remember if
the "rules" are not to use internal services at all, or simply not to
extend them.

chris

Petros Petrou wrote:
> Thanks Kris/Sven, 
>
> The version I am using is 5.0.13. 
>
> Kris, if I am understanding your explanation correctly this means I have no
> way of using this code
> renderSupport.addScript("%s.show%s(%s);", window1.getClientId(), isCenter()
> ? "Center" : "", isModal()); 
> within an action method ?
>
> PS: This is my original issue
> http://www.nabble.com/t5components---Window-to18087605.html 
> Sorry if I complicated things by creating two different issues. 
> Sven, sorry about all these questions but my Javascript skills are very
> limited.
>
>
> Petros
>  
>
>
> kristian.marinkovic wrote:
>   
>> the RenderSupport service is only available during
>> the render phase (page rendering)
>>
>> you are trying to access it during the component event
>> phase 
>>
>> (i hope i used the correct terms :))
>>
>> g,
>> kris
>>
>>
>>
>>
>> "Sven Homburg" <[EMAIL PROTECTED]> 
>> 22.07.2008 14:44
>> Bitte antworten an
>> "Tapestry users" 
>>
>>
>> An
>> "Tapestry users" 
>> Kopie
>>
>> Thema
>> Re: @Environment problem
>>
>>
>>
>>
>>
>>
>> wich version of tapestry are you using (5.0.??)
>>
>> 2008/7/22 Petros Petrou <[EMAIL PROTECTED]>:
>>
>> 
>>> I have the following code
>>>
>>> Test.java
>>>@Environmental
>>>private RenderSupport renderSupport;
>>>
>>>   @OnEvent(value = "action", component = "openWindowActionLink")
>>>void onActionFromOpenWindowActionLink()
>>>{
>>>renderSupport.getClass();
>>>}
>>>
>>> Test.tml
>>> Open Window
>>>
>>>
>>> When the Open Window link is clicked I am getting the following 
>>>   
>> exception
>> 
>>> No object of type org.apache.tapestry5.RenderSupport is available from 
>>>   
>> the
>> 
>>> Environment. Available types are
>>> org.apache.tapestry5.services.ComponentEventResultProcessor.
>>>
>>> Does anyone know how I can even approach this problem.
>>>
>>> Petros
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/%40Environment-problem-tp18587443p18587443.html
>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>   
>> -- 
>> with regards
>> Sven Homburg
>> http://tapestry5-components.googlecode.com
>> http://chenillekit.googlecode.com
>>
>>
>>
>> 
>
>   

-- 
http://thegodcode.net



Re: @Environment problem

2008-07-22 Thread Kristian Marinkovic
hi petros,

right... you can't use it in an onAction method (component event
method)

a possible solution is to save some informaton in a persistent 
field (session or flash) that is then evaluated during the render 
phase.

as you know, after each component event t5 performs a redirect
to initiate the page rendering. because of the statelessness of 
t5 components/pages you have to somehow remember the 
state info yourself if page/component rendering depends on a 
previous component action.

hope this makes sense :)... 

a simple example:

@Persist("flash")
private boolean renderScriptFlag;

void onActionFromLink()
{
renderScript = true;
}

void beginRender()
{
if(renderScriptFlag)
renderSuport.addScript();
}


g,
kris




Petros Petrou <[EMAIL PROTECTED]> 
22.07.2008 17:05
Bitte antworten an
"Tapestry users" 


An
users@tapestry.apache.org
Kopie

Thema
Re: @Environment problem








Thanks Kris/Sven, 

The version I am using is 5.0.13. 

Kris, if I am understanding your explanation correctly this means I have 
no
way of using this code
renderSupport.addScript("%s.show%s(%s);", window1.getClientId(), 
isCenter()
? "Center" : "", isModal()); 
within an action method ?

PS: This is my original issue
http://www.nabble.com/t5components---Window-to18087605.html 
Sorry if I complicated things by creating two different issues. 
Sven, sorry about all these questions but my Javascript skills are very
limited.


Petros
 


kristian.marinkovic wrote:
> 
> the RenderSupport service is only available during
> the render phase (page rendering)
> 
> you are trying to access it during the component event
> phase 
> 
> (i hope i used the correct terms :))
> 
> g,
> kris
> 
> 
> 
> 
> "Sven Homburg" <[EMAIL PROTECTED]> 
> 22.07.2008 14:44
> Bitte antworten an
> "Tapestry users" 
> 
> 
> An
> "Tapestry users" 
> Kopie
> 
> Thema
> Re: @Environment problem
> 
> 
> 
> 
> 
> 
> wich version of tapestry are you using (5.0.??)
> 
> 2008/7/22 Petros Petrou <[EMAIL PROTECTED]>:
> 
>>
>> I have the following code
>>
>> Test.java
>>@Environmental
>>private RenderSupport renderSupport;
>>
>>   @OnEvent(value = "action", component = "openWindowActionLink")
>>void onActionFromOpenWindowActionLink()
>>{
>>renderSupport.getClass();
>>}
>>
>> Test.tml
>> Open Window
>>
>>
>> When the Open Window link is clicked I am getting the following 
> exception
>> No object of type org.apache.tapestry5.RenderSupport is available from 
> the
>> Environment. Available types are
>> org.apache.tapestry5.services.ComponentEventResultProcessor.
>>
>> Does anyone know how I can even approach this problem.
>>
>> Petros
>>
>> --
>> View this message in context:
>> http://www.nabble.com/%40Environment-problem-tp18587443p18587443.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> -- 
> with regards
> Sven Homburg
> http://tapestry5-components.googlecode.com
> http://chenillekit.googlecode.com
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/%40Environment-problem-tp18587443p18591002.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: @Environment problem

2008-07-22 Thread Petros Petrou

Thanks Kris/Sven, 

The version I am using is 5.0.13. 

Kris, if I am understanding your explanation correctly this means I have no
way of using this code
renderSupport.addScript("%s.show%s(%s);", window1.getClientId(), isCenter()
? "Center" : "", isModal()); 
within an action method ?

PS: This is my original issue
http://www.nabble.com/t5components---Window-to18087605.html 
Sorry if I complicated things by creating two different issues. 
Sven, sorry about all these questions but my Javascript skills are very
limited.


Petros
 


kristian.marinkovic wrote:
> 
> the RenderSupport service is only available during
> the render phase (page rendering)
> 
> you are trying to access it during the component event
> phase 
> 
> (i hope i used the correct terms :))
> 
> g,
> kris
> 
> 
> 
> 
> "Sven Homburg" <[EMAIL PROTECTED]> 
> 22.07.2008 14:44
> Bitte antworten an
> "Tapestry users" 
> 
> 
> An
> "Tapestry users" 
> Kopie
> 
> Thema
> Re: @Environment problem
> 
> 
> 
> 
> 
> 
> wich version of tapestry are you using (5.0.??)
> 
> 2008/7/22 Petros Petrou <[EMAIL PROTECTED]>:
> 
>>
>> I have the following code
>>
>> Test.java
>>@Environmental
>>private RenderSupport renderSupport;
>>
>>   @OnEvent(value = "action", component = "openWindowActionLink")
>>void onActionFromOpenWindowActionLink()
>>{
>>renderSupport.getClass();
>>}
>>
>> Test.tml
>> Open Window
>>
>>
>> When the Open Window link is clicked I am getting the following 
> exception
>> No object of type org.apache.tapestry5.RenderSupport is available from 
> the
>> Environment. Available types are
>> org.apache.tapestry5.services.ComponentEventResultProcessor.
>>
>> Does anyone know how I can even approach this problem.
>>
>> Petros
>>
>> --
>> View this message in context:
>> http://www.nabble.com/%40Environment-problem-tp18587443p18587443.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> -- 
> with regards
> Sven Homburg
> http://tapestry5-components.googlecode.com
> http://chenillekit.googlecode.com
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/%40Environment-problem-tp18587443p18591002.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: @Environment problem

2008-07-22 Thread Kristian Marinkovic
the RenderSupport service is only available during
the render phase (page rendering)

you are trying to access it during the component event
phase 

(i hope i used the correct terms :))

g,
kris




"Sven Homburg" <[EMAIL PROTECTED]> 
22.07.2008 14:44
Bitte antworten an
"Tapestry users" 


An
"Tapestry users" 
Kopie

Thema
Re: @Environment problem






wich version of tapestry are you using (5.0.??)

2008/7/22 Petros Petrou <[EMAIL PROTECTED]>:

>
> I have the following code
>
> Test.java
>@Environmental
>private RenderSupport renderSupport;
>
>   @OnEvent(value = "action", component = "openWindowActionLink")
>void onActionFromOpenWindowActionLink()
>{
>renderSupport.getClass();
>}
>
> Test.tml
> Open Window
>
>
> When the Open Window link is clicked I am getting the following 
exception
> No object of type org.apache.tapestry5.RenderSupport is available from 
the
> Environment. Available types are
> org.apache.tapestry5.services.ComponentEventResultProcessor.
>
> Does anyone know how I can even approach this problem.
>
> Petros
>
> --
> View this message in context:
> http://www.nabble.com/%40Environment-problem-tp18587443p18587443.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
with regards
Sven Homburg
http://tapestry5-components.googlecode.com
http://chenillekit.googlecode.com



Re: @Environment problem

2008-07-22 Thread Sven Homburg
wich version of tapestry are you using (5.0.??)

2008/7/22 Petros Petrou <[EMAIL PROTECTED]>:

>
> I have the following code
>
> Test.java
>@Environmental
>private RenderSupport renderSupport;
>
>   @OnEvent(value = "action", component = "openWindowActionLink")
>void onActionFromOpenWindowActionLink()
>{
>renderSupport.getClass();
>}
>
> Test.tml
> Open Window
>
>
> When the Open Window link is clicked I am getting the following exception
> No object of type org.apache.tapestry5.RenderSupport is available from the
> Environment. Available types are
> org.apache.tapestry5.services.ComponentEventResultProcessor.
>
> Does anyone know how I can even approach this problem.
>
> Petros
>
> --
> View this message in context:
> http://www.nabble.com/%40Environment-problem-tp18587443p18587443.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
with regards
Sven Homburg
http://tapestry5-components.googlecode.com
http://chenillekit.googlecode.com


@Environment problem

2008-07-22 Thread Petros Petrou

I have the following code

Test.java
@Environmental
private RenderSupport renderSupport; 

   @OnEvent(value = "action", component = "openWindowActionLink")
void onActionFromOpenWindowActionLink()
{
renderSupport.getClass();
}

Test.tml
Open Window


When the Open Window link is clicked I am getting the following exception 
No object of type org.apache.tapestry5.RenderSupport is available from the
Environment. Available types are
org.apache.tapestry5.services.ComponentEventResultProcessor.

Does anyone know how I can even approach this problem. 

Petros

-- 
View this message in context: 
http://www.nabble.com/%40Environment-problem-tp18587443p18587443.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]