You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by daniel joyce <da...@gmail.com> on 2009/04/16 06:31:38 UTC

@Inject @Symbol doesn't appear to work in pages?

This doesn't seem to work in a page model file

    @Inject
    @Symbol(value=SymbolConstants.PRODUCTION_MODE)
    private Boolean productionMode;

I get a nullpointerexception when I try and use it.

Also, is the magic method name onPageLoad() for setting up vars at
page instance load time?

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


Re: @Inject @Symbol doesn't appear to work in pages?

Posted by daniel joyce <da...@gmail.com>.
http://tapestry.formos.com/nightly/tapestry5/guide/lifecycle.html

has

The annotations / method names are:

    * PageLoaded annotation, or method name "pageLoaded"
    * PageAttached annotation, or method name "pageAttached"
    * PageDetached annotation, or method name "pageDetached"

I'll try your annotation suggestion.

On Thu, Apr 16, 2009 at 11:31 AM, Borut Bolčina <bo...@gmail.com> wrote:
> Hi,
>
> I am doing this and it works:
>
>    @Inject @Symbol(SymbolConstants.PRODUCTION_MODE)
>    private boolean productionMode;
>
> -Borut
>
> 2009/4/16 daniel joyce <da...@gmail.com>:
>> This doesn't seem to work in a page model file
>>
>>    @Inject
>>    @Symbol(value=SymbolConstants.PRODUCTION_MODE)
>>    private Boolean productionMode;
>>
>> I get a nullpointerexception when I try and use it.
>>
>> Also, is the magic method name onPageLoad() for setting up vars at
>> page instance load time?
>>
>> ---------------------------------------------------------------------
>> 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: @Inject @Symbol doesn't appear to work in pages?

Posted by Borut Bolčina <bo...@gmail.com>.
Hi,

I am doing this and it works:

    @Inject @Symbol(SymbolConstants.PRODUCTION_MODE)
    private boolean productionMode;

-Borut

2009/4/16 daniel joyce <da...@gmail.com>:
> This doesn't seem to work in a page model file
>
>    @Inject
>    @Symbol(value=SymbolConstants.PRODUCTION_MODE)
>    private Boolean productionMode;
>
> I get a nullpointerexception when I try and use it.
>
> Also, is the magic method name onPageLoad() for setting up vars at
> page instance load time?
>
> ---------------------------------------------------------------------
> 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: @Inject @Symbol doesn't appear to work in pages?

Posted by Howard Lewis Ship <hl...@gmail.com>.
Seems to me it should work for boolean or Boolean. I'm not sure why it doesn't.

On Thu, Apr 16, 2009 at 5:35 AM, Thiago H. de Paula Figueiredo
<th...@gmail.com> wrote:
> On Thu, Apr 16, 2009 at 1:31 AM, daniel joyce <da...@gmail.com> wrote:
>> This doesn't seem to work in a page model file
>>
>>    @Inject
>>    @Symbol(value=SymbolConstants.PRODUCTION_MODE)
>>    private Boolean productionMode;
>> I get a nullpointerexception when I try and use it.
>
> Try boolean instead of Boolean.
>
>> Also, is the magic method name onPageLoad() for setting up vars at
>> page instance load time?
>
> It's onPageLoaded(). Or you can use any method name, but annotate it
> with @PageLoaded. The documentation of page events is here:
> http://tapestry.apache.org/tapestry5/guide/lifecycle.html.
>
> --
> Thiago
>
> ---------------------------------------------------------------------
> 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

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


Re: @Inject @Symbol doesn't appear to work in pages?

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Thu, Apr 16, 2009 at 1:31 AM, daniel joyce <da...@gmail.com> wrote:
> This doesn't seem to work in a page model file
>
>    @Inject
>    @Symbol(value=SymbolConstants.PRODUCTION_MODE)
>    private Boolean productionMode;
> I get a nullpointerexception when I try and use it.

Try boolean instead of Boolean.

> Also, is the magic method name onPageLoad() for setting up vars at
> page instance load time?

It's onPageLoaded(). Or you can use any method name, but annotate it
with @PageLoaded. The documentation of page events is here:
http://tapestry.apache.org/tapestry5/guide/lifecycle.html.

-- 
Thiago

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