Environmental not avaible during action

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Environmental not avaible during action

Lherm Nicolas
In my application, I have a zone with many components inside.

The first time page render is ok. But when I click an Action link which will refresh the zone,I can't get Environmental Object.

And I get an Error like this:

classpath:.../BlocPriseEnCharge.tml, line 23
org.apache.tapestry5.ioc.internal.util.TapestryException
Failure reading parameter 'model' of component SaisieFacture:formcontent.blocpriseencharge.zoneobservation: No object of type
....EnumCorgamo is available from the Environment.

location
classpath:.../BlocPriseEnCharge.tml, line 23
org.apache.tapestry5.ioc.util.UnknownValueException
No object of type ....EnumCorgamo is available from the Environment.

availableValues

Environmentals:

  *   ....EnumCorgamo
  *   fr.msa.agora.socle.g2.tapestry.services.ShowUpSupport
  *   fr.msa.agora.socle.g2.tapestry.services.Zoning3Support
  *   org.apache.tapestry5.RenderSupport
  *   org.apache.tapestry5.ValidationDecorator
  *   org.apache.tapestry5.ValidationTracker
  *   org.apache.tapestry5.internal.BeanValidationContext
  *   org.apache.tapestry5.internal.beaneditor.EnvironmentMessages
  *   org.apache.tapestry5.internal.services.DocumentLinker
  *   org.apache.tapestry5.services.ClientBehaviorSupport
  *   org.apache.tapestry5.services.FormSupport
  *   org.apache.tapestry5.services.Heartbeat
  *   org.apache.tapestry5.services.javascript.JavaScriptSupport

I use tapestry 5.3.8 now. But it works when I use tapestry 2.6.






Reply | Threaded
Open this post in threaded view
|

Re: Environmental not avaible during action

Thiago H. de Paula Figueiredo
Hi!

On Mon, 20 Jun 2016 04:40:22 -0300, Lherm Nicolas <[hidden email]> wrote:

> In my application, I have a zone with many components inside.
>
> The first time page render is ok. But when I click an Action link which  
> will refresh the zone,I can't get Environmental Object.

What code puts an EnumCorgamo into the Environment in first place? It's  
not being called when your event is triggered.

> I use tapestry 5.3.8 now. But it works when I use tapestry 2.6.

Are you sure about using 2.6? :p

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Environmental not avaible during action

Lherm Nicolas
Hi,


EnumCorgamo is the context of the execution, an enumeration with some Strings, and methods thats returns codes (strings)


Yes, it was Tapestry 5.2.6 [?]

________________________________
De : Thiago H de Paula Figueiredo <[hidden email]>
Envoy? : lundi 20 juin 2016 19:45:28
? : Tapestry users
Objet : Re: Environmental not avaible during action

Hi!

On Mon, 20 Jun 2016 04:40:22 -0300, Lherm Nicolas <[hidden email]> wrote:

> In my application, I have a zone with many components inside.
>
> The first time page render is ok. But when I click an Action link which
> will refresh the zone,I can't get Environmental Object.

What code puts an EnumCorgamo into the Environment in first place? It's
not being called when your event is triggered.

> I use tapestry 5.3.8 now. But it works when I use tapestry 2.6.

Are you sure about using 2.6? :p

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Environmental not avaible during action

Lherm Nicolas

In my app.tml I put an <t:trigger event="setupRender" /> that refers to my app.java to :


void onSetupRender() {
        environment.push(EnumCorgamo.class, corgamo);
   }

but it still doesn't works


De : Lherm Nicolas
Envoyé : mercredi 22 juin 2016 16:04:09
À : Tapestry users
Objet : RE: Environmental not avaible during action
 

Hi,


EnumCorgamo is the context of the execution, an enumeration with some Strings, and methods thats returns codes (strings)


Yes, it was Tapestry 5.2.6 <img class="x_EmojiInsert" alt="😁" style="vertical-align:bottom" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAa9JREFUeNqsVE9LAlEQn1XxIIornYzAd&#43;7Sgn2A7dTVLl1dCIpu6ycwP0CY1y5tlw6dhLqG&#43;wGS2msQrRQIgriL4CGIbeb19rX&#43;KRUdGB9vfjO/nRlnnhIEAaxLlFnG4LHI8Kii6qgsArmoNmpN2W27c8mQqI6HuUAiF0hY&#43;ZMMiZ7w0JaorImEB&#43;ElNpGRtmSbSiLulwwNeliadd&#43;HvZMXsNvDmdFkJ5z8hJgiXmZWDpHGTY8H1C67M8nITjj5RaQse4bMAzzUKOoNv0DNxKfIQvsE7mHvcooYg7c1jFkuNjFHq4iWEIMo&#43;&#43;GlDqGwtQH&#43;xwPsFDxQUyPp/fwaB8dVgW3vg&#43;chNrqF6nFewuFYDFADTdOCUFqtljx1XR&#43;7h8L9MU70XP6bTfpRkz2wLAtc1&#43;VfJkEiqXyfECMlP/KPxifE5RrVqB6lodJocIPjODzI932wbZvbstksdDqdnxFCv/ppGiLx4ztJKV&#43;dscAwjLFyTNMcK59w8hMl1v/dTbf7CZXzd1BZCRhjPDMqkzKF/h02fRNYPjm1m3Nfjeha6cXM4q/Gyu/ZOl/abwEGABKODaJuuq0CAAAAAElFTkSuQmCC">


De : Thiago H de Paula Figueiredo <[hidden email]>
Envoyé : lundi 20 juin 2016 19:45:28
À : Tapestry users
Objet : Re: Environmental not avaible during action
 
Hi!

On Mon, 20 Jun 2016 04:40:22 -0300, Lherm Nicolas <[hidden email]> wrote:

> In my application, I have a zone with many components inside.
>
> The first time page render is ok. But when I click an Action link which 
> will refresh the zone,I can't get Environmental Object.

What code puts an EnumCorgamo into the Environment in first place? It's 
not being called when your event is triggered.

> I use tapestry 5.3.8 now. But it works when I use tapestry 2.6.

Are you sure about using 2.6? :p

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


NICOLAS LHERM 

[hidden email]
Tél :+33 (0)1 55 93 26 00
www.sqli.com - www.sqli-enterprise.com
Digital That Works

Reply | Threaded
Open this post in threaded view
|

Re: Environmental not avaible during action

Thiago H. de Paula Figueiredo
On Wed, 22 Jun 2016 11:58:23 -0300, Lherm Nicolas <[hidden email]> wrote:

In my app.tml I put an <t:trigger event="setupRender" /> that refers to my app.java to :


void onSetupRender() {
        environment.push(EnumCorgamo.class, corgamo);
   }

but it still doesn't works

That's because the corgamo variable is null during your event request, only being properly setup during rendering. You should instead pass this value as the context (or part of it) of your ActionLinks




De : Lherm Nicolas
Envoyé : mercredi 22 juin 2016 16:04:09
À : Tapestry users
Objet : RE: Environmental not avaible during action
 

Hi,


EnumCorgamo is the context of the execution, an enumeration with some Strings, and methods thats returns codes (strings)


Yes, it was Tapestry 5.2.6 <img class="x_EmojiInsert" alt="😁" style="vertical-align:bottom" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAa9JREFUeNqsVE9LAlEQn1XxIIornYzAd+7Sgn2A7dTVLl1dCIpu6ycwP0CY1y5tlw6dhLqG+wGS2msQrRQIgriL4CGIbeb19rX+KRUdGB9vfjO/nRlnnhIEAaxLlFnG4LHI8Kii6qgsArmoNmpN2W27c8mQqI6HuUAiF0hY+ZMMiZ7w0JaorImEB+ElNpGRtmSbSiLulwwNeliadd+HvZMXsNvDmdFkJ5z8hJgiXmZWDpHGTY8H1C67M8nITjj5RaQse4bMAzzUKOoNv0DNxKfIQvsE7mHvcooYg7c1jFkuNjFHq4iWEIMo++GlDqGwtQH+xwPsFDxQUyPp/fwaB8dVgW3vg+chNrqF6nFewuFYDFADTdOCUFqtljx1XR+7h8L9MU70XP6bTfpRkz2wLAtc1+VfJkEiqXyfECMlP/KPxifE5RrVqB6lodJocIPjODzI932wbZvbstksdDqdnxFCv/ppGiLx4ztJKV+dscAwjLFyTNMcK59w8hMl1v/dTbf7CZXzd1BZCRhjPDMqkzKF/h02fRNYPjm1m3Nfjeha6cXM4q/Gyu/ZOl/abwEGABKODaJuuq0CAAAAAElFTkSuQmCC">


De : Thiago H de Paula Figueiredo <[hidden email]>
Envoyé : lundi 20 juin 2016 19:45:28
À : Tapestry users
Objet : Re: Environmental not avaible during action
 
Hi!

On Mon, 20 Jun 2016 04:40:22 -0300, Lherm Nicolas <[hidden email]> wrote:

> In my application, I have a zone with many components inside.
>
> The first time page render is ok. But when I click an Action link which 
> will refresh the zone,I can't get Environmental Object.

What code puts an EnumCorgamo into the Environment in first place? It's 
not being called when your event is triggered.

> I use tapestry 5.3.8 now. But it works when I use tapestry 2.6.

Are you sure about using 2.6? :p

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


NICOLAS LHERM 

[hidden email]
Tél :+33 (0)1 55 93 26 00
www.sqli.com - www.sqli-enterprise.com
Digital That Works




--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
Reply | Threaded
Open this post in threaded view
|

RE: Environmental not avaible during action

Lherm Nicolas
I pass the value in the context via t:context="corgamo". So the actionEvent seems to works but the zone isn't render yet.


I still have the same error of environment

________________________________
De : Thiago H de Paula Figueiredo <[hidden email]>
Envoyé : mercredi 22 juin 2016 17:18:16
À : Tapestry users
Objet : Re: Environmental not avaible during action

On Wed, 22 Jun 2016 11:58:23 -0300, Lherm Nicolas <[hidden email]> wrote:


In my app.tml I put an <t:trigger event="setupRender" /> that refers to my app.java to :


void onSetupRender() {
        environment.push(EnumCorgamo.class, corgamo);
   }

but it still doesn't works [:(]

That's because the corgamo variable is null during your event request, only being properly setup during rendering. You should instead pass this value as the context (or part of it) of your ActionLinks



________________________________
De : Lherm Nicolas
Envoyé : mercredi 22 juin 2016 16:04:09
À : Tapestry users
Objet : RE: Environmental not avaible during action


Hi,


EnumCorgamo is the context of the execution, an enumeration with some Strings, and methods thats returns codes (strings)


Yes, it was Tapestry 5.2.6 [??]

________________________________
De : Thiago H de Paula Figueiredo <[hidden email]>
Envoyé : lundi 20 juin 2016 19:45:28
À : Tapestry users
Objet : Re: Environmental not avaible during action

Hi!

On Mon, 20 Jun 2016 04:40:22 -0300, Lherm Nicolas <[hidden email]> wrote:

> In my application, I have a zone with many components inside.
>
> The first time page render is ok. But when I click an Action link which
> will refresh the zone,I can't get Environmental Object.

What code puts an EnumCorgamo into the Environment in first place? It's
not being called when your event is triggered.

> I use tapestry 5.3.8 now. But it works when I use tapestry 2.6.

Are you sure about using 2.6? :p

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


[http://letsignit.sqli.com/lsi/static/bb39a8fe1f234ec6a06b4d9a4b720b81/SQLI_ENTERPRISE_poursignature.jpg]
NICOLAS LHERM

[hidden email]<mailto:[hidden email]>
Tél :+33 (0)1 55 93 26 00
www.sqli.com <http://letsignit.sqli.com/r/1/f15399b2-554d-400d-aed3-3eb146a8c803> - www.sqli-enterprise.com<http://letsignit.sqli.com/r/10/dfa93beb-1daf-44f3-b27a-f160a2b2b07f>
[http://letsignit.sqli.com/lsi/static/bb39a8fe1f234ec6a06b4d9a4b720b81/Pictos/linkedin_enterprise.jpg]<http://letsignit.sqli.com/r/11/ff4707cb-8cc9-49bc-a565-393aca191cba>     [http://letsignit.sqli.com/lsi/static/bb39a8fe1f234ec6a06b4d9a4b720b81/Pictos/twitter_enterprise.jpg] <http://letsignit.sqli.com/r/25/ff74b193-056a-45c5-954a-1e50d97c66bf>     [http://letsignit.sqli.com/lsi/static/bb39a8fe1f234ec6a06b4d9a4b720b81/Pictos/facebook_enterprise.jpg] <http://letsignit.sqli.com/r/12/221a7b2a-d9e2-42e0-b4f2-039829ab6960>    [http://letsignit.sqli.com/lsi/static/bb39a8fe1f234ec6a06b4d9a4b720b81/Pictos/youtube_enterprise.jpg] <http://letsignit.sqli.com/r/7/63015f89-ac9e-4c92-a5e2-c9f1677295ca>                      Digital That Works


[http://letsignit.sqli.com/lsi/static/bb39a8fe1f234ec6a06b4d9a4b720b81/LiveforGood/Plan_de_travail_1_copie_2.png]<http://letsignit.sqli.com/r/112/e30d7ae7-a5c2-484b-bb5a-798ac8342344>



--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
Reply | Threaded
Open this post in threaded view
|

Re: Environmental not avaible during action

Thiago H. de Paula Figueiredo
On Mon, 27 Jun 2016 10:37:07 -0300, Lherm Nicolas <[hidden email]> wrote:

> I pass the value in the context via t:context="corgamo". So the  
> actionEvent seems to works but the zone isn't render yet.
> I still have the same error of environment

That's because you haven't pushed the corgamo value into the environment.  
Try adding the following line as the first one in your event handler:  
environment.push(EnumCorgamo.class, corgamo); If it doesn't work, instead  
of having an @Environmental private EnumCorgamo corgamo; @Inject the  
Environment service and use environment.peek(EnumCorgamo.class) instead.

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Environmental not avaible during action

Lherm Nicolas
I already pushed the corgamo value into the environment as I mentioned before but as I saw in debug mode, the environment contains the enum class but I still have the same error wich says that there is no environment..


I saw that in the environment class there is the cloak() and decloak() method. Maybe that the environment is cloak when it render the new zone.


________________________________
De : Thiago H de Paula Figueiredo <[hidden email]>
Envoyé : lundi 27 juin 2016 21:10
À : Tapestry users
Objet : Re: Environmental not avaible during action

On Mon, 27 Jun 2016 10:37:07 -0300, Lherm Nicolas <[hidden email]> wrote:

> I pass the value in the context via t:context="corgamo". So the
> actionEvent seems to works but the zone isn't render yet.
> I still have the same error of environment

That's because you haven't pushed the corgamo value into the environment.
Try adding the following line as the first one in your event handler:
environment.push(EnumCorgamo.class, corgamo); If it doesn't work, instead
of having an @Environmental private EnumCorgamo corgamo; @Inject the
Environment service and use environment.peek(EnumCorgamo.class) instead.

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Environmental not avaible during action

Thiago H. de Paula Figueiredo
On Wed, 06 Jul 2016 06:31:19 -0300, Lherm Nicolas <[hidden email]> wrote:

> I already pushed the corgamo value into the environment as I mentioned  
> before

Did you that in the *event* request? Doing that in the page render request  
doesn't make it available for other requests, such the event one.

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Environmental not avaible during action

Lherm Nicolas
Yes it is only in the event request.


> Le 6 juil. 2016 à 15:32, Thiago H de Paula Figueiredo <[hidden email]> a écrit :
>
>> On Wed, 06 Jul 2016 06:31:19 -0300, Lherm Nicolas <[hidden email]> wrote:
>>
>> I already pushed the corgamo value into the environment as I mentioned before
>
> Did you that in the *event* request? Doing that in the page render request doesn't make it available for other requests, such the event one.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
Reply | Threaded
Open this post in threaded view
|

RE: Environmental not avaible during action

Lherm Nicolas
I also put a test in the event request to verify if the environment was null but it was useless:


if (environment.peek(EnumCorgamo.class) == null) {
            environment.decloak();
            environment.push(EnumCorgamo.class, corgamo);
        }


________________________________
De : Lherm Nicolas
Envoyé : mercredi 6 juillet 2016 15:37:04
À : Tapestry users
Objet : Re: Environmental not avaible during action

Yes it is only in the event request.


> Le 6 juil. 2016 à 15:32, Thiago H de Paula Figueiredo <[hidden email]> a écrit :
>
>> On Wed, 06 Jul 2016 06:31:19 -0300, Lherm Nicolas <[hidden email]> wrote:
>>
>> I already pushed the corgamo value into the environment as I mentioned before
>
> Did you that in the *event* request? Doing that in the page render request doesn't make it available for other requests, such the event one.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
Reply | Threaded
Open this post in threaded view
|

Re: Environmental not avaible during action

Thiago H. de Paula Figueiredo
On Wed, 06 Jul 2016 10:51:24 -0300, Lherm Nicolas <[hidden email]> wrote:

> I also put a test in the event request to verify if the environment was  
> null but it was useless:
>
>
> if (environment.peek(EnumCorgamo.class) == null) {
>             environment.decloak();
>             environment.push(EnumCorgamo.class, corgamo);
>         }

Have you tried this suggestion I've done before?

Instead of having an "@Environmental private EnumCorgamo corgamo;" @Inject  
the Environment service and use environment.peek(EnumCorgamo.class)  
instead.

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Environmental not avaible during action

Lherm Nicolas
Yes i already use this one too. But I didn't saw any change

> Le 6 juil. 2016 à 20:03, Thiago H de Paula Figueiredo <[hidden email]> a écrit :
>
>> On Wed, 06 Jul 2016 10:51:24 -0300, Lherm Nicolas <[hidden email]> wrote:
>>
>> I also put a test in the event request to verify if the environment was null but it was useless:
>>
>>
>> if (environment.peek(EnumCorgamo.class) == null) {
>>            environment.decloak();
>>            environment.push(EnumCorgamo.class, corgamo);
>>        }
>
> Have you tried this suggestion I've done before?
>
> Instead of having an "@Environmental private EnumCorgamo corgamo;" @Inject the Environment service and use environment.peek(EnumCorgamo.class) instead.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
Reply | Threaded
Open this post in threaded view
|

Re: Environmental not avaible during action

Thiago H. de Paula Figueiredo
On Wed, 06 Jul 2016 15:43:49 -0300, Lherm Nicolas <[hidden email]> wrote:

> Yes i already use this one too. But I didn't saw any change

Could you post the whole code related to this? Otherwise, I'm not sure how  
to help you further.

>
>> Le 6 juil. 2016 à 20:03, Thiago H de Paula Figueiredo  
>> <[hidden email]> a écrit :
>>
>>> On Wed, 06 Jul 2016 10:51:24 -0300, Lherm Nicolas <[hidden email]>  
>>> wrote:
>>>
>>> I also put a test in the event request to verify if the environment  
>>> was null but it was useless:
>>>
>>>
>>> if (environment.peek(EnumCorgamo.class) == null) {
>>>            environment.decloak();
>>>            environment.push(EnumCorgamo.class, corgamo);
>>>        }
>>
>> Have you tried this suggestion I've done before?
>>
>> Instead of having an "@Environmental private EnumCorgamo corgamo;"  
>> @Inject the Environment service and use  
>> environment.peek(EnumCorgamo.class) instead.
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Tapestry, Java and Hibernate consultant and developer
>> http://machina.com.br
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>


--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]