You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Lherm Nicolas <nl...@sqli.com> on 2016/07/06 09:31:19 UTC

RE: Environmental not avaible during action

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 <th...@gmail.com>
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 <nl...@sqli.com> 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: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Environmental not avaible during action

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Wed, 06 Jul 2016 15:43:49 -0300, Lherm Nicolas <nl...@sqli.com> 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  
>> <th...@gmail.com> a écrit :
>>
>>> On Wed, 06 Jul 2016 10:51:24 -0300, Lherm Nicolas <nl...@sqli.com>  
>>> 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: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>


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

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


Re: Environmental not avaible during action

Posted by Lherm Nicolas <nl...@sqli.com>.
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 <th...@gmail.com> a écrit :
> 
>> On Wed, 06 Jul 2016 10:51:24 -0300, Lherm Nicolas <nl...@sqli.com> 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: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 

Re: Environmental not avaible during action

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Wed, 06 Jul 2016 10:51:24 -0300, Lherm Nicolas <nl...@sqli.com> 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: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


RE: Environmental not avaible during action

Posted by Lherm Nicolas <nl...@sqli.com>.
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 <th...@gmail.com> a écrit :
>
>> On Wed, 06 Jul 2016 06:31:19 -0300, Lherm Nicolas <nl...@sqli.com> 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: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

Re: Environmental not avaible during action

Posted by Lherm Nicolas <nl...@sqli.com>.
Yes it is only in the event request.


> Le 6 juil. 2016 à 15:32, Thiago H de Paula Figueiredo <th...@gmail.com> a écrit :
> 
>> On Wed, 06 Jul 2016 06:31:19 -0300, Lherm Nicolas <nl...@sqli.com> 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: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 

Re: Environmental not avaible during action

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Wed, 06 Jul 2016 06:31:19 -0300, Lherm Nicolas <nl...@sqli.com> 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: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org