You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ken in Nashua <kc...@live.com> on 2013/05/20 16:45:33 UTC

help constructing a page activation context

Hi Tapestry Pro's...
Good morning..

I was wondering about my page. 

Here is the link to my page... its basically a prototype I will retrofit in later.

http://localhost:8080/pphl/rosterquery

My page renders and everything is good. I select my criteria and hit GO (submit).

My tabel list gets populated and rendered...

BUT... my page keeps taking off to somewhere else like 

http://localhost:8080/team

or 

http://localhost:8080/player

or 

http://localhost:8080/pphl/rosterquery.criteriaform  with an HTTP error 404

I looked at my passivate routine and not sure what to put in it.

I wuold like to return to the same page

http://localhost:8080/pphl/rosterquery but when I return this from my submit it doesnt work.

any ideas ?

Thank You
Ken


    @OnEvent(EventConstants.PASSIVATE)
    Object[] passivate() {
        return new Object[] { beanType };
    }
 		 	   		  

RE: help constructing a page activation context

Posted by Ken in Nashua <kc...@live.com>.
This seems to help me stay on the same page...

/*
    @OnEvent(EventConstants.ACTIVATE)
    Object onActivate(Class clazz) {
        if (clazz == null)
            return Utils.new404(messages);
        this.beanType = clazz;
        return null;
    }
*/
    @OnEvent(EventConstants.PASSIVATE)
    Object[] passivate() {
        return new Object[] { team, team.getId(), this };
    }

but I had to comment out onActivate... as it kept coming in with null CLAZZ

is this a tapestry bug ?

I could not get any parameters to come in based on the onPassivate I designed.

But this is what I get for a URL...

http://localhost:8080/org.tynamo.examples.pphl.pages.RosterQuery$0040337893/1/1

how do you explain that ?
 		 	   		  

Re: help constructing a page activation context

Posted by Geoff Callender <ge...@gmail.com>.
The output of onPassivate becomes the input of onActivate. It goes out to the URL and in from the URL. They should match.

http://jumpstart.doublenegative.com.au/jumpstart/examples/navigation/onactivateandonpassivate/3

Cheers,

Geoff

On 21/05/2013, at 4:04 AM, Ken in Nashua wrote:

> I tried the context specified below but clazz during activation always comes in as null.
> 
> is this a tapestry bug ?    
> 
> @OnEvent(EventConstants.ACTIVATE)
>    Object onActivate(Class clazz) {
>        if (clazz == null)
>            return Utils.new404(messages);
>        this.beanType = clazz;
>        return null;
>    }
> 
>    @OnEvent(EventConstants.PASSIVATE)
>    Object[] passivate() {
>        return new Object[] { team, team.getId(), this };
>    } 		 	   		  


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


Re: help constructing a page activation context

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Mon, 20 May 2013 15:04:35 -0300, Ken in Nashua <kc...@live.com>  
wrote:

> I tried the context specified below but clazz during activation always  
> comes in as null.
>
> is this a tapestry bug ?

No. If you wan to get the class as the first page activation context  
value, it should be the first value in the List or array you return in  
onPassivate(). Keep in mind that the same order of values in onActivate()  
should be used in onPassivate(). By the way, including 'this' in the  
activation context makes no sense to me.

>
> @OnEvent(EventConstants.ACTIVATE)
>     Object onActivate(Class clazz) {
>         if (clazz == null)
>             return Utils.new404(messages);
>         this.beanType = clazz;
>         return null;
>     }
>
>     @OnEvent(EventConstants.PASSIVATE)
>     Object[] passivate() {
>         return new Object[] { team, team.getId(), this };
>     } 		 	   		


-- 
Thiago H. de Paula Figueiredo

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


RE: help constructing a page activation context

Posted by Ken in Nashua <kc...@live.com>.
I tried the context specified below but clazz during activation always comes in as null.

is this a tapestry bug ?    

@OnEvent(EventConstants.ACTIVATE)
    Object onActivate(Class clazz) {
        if (clazz == null)
            return Utils.new404(messages);
        this.beanType = clazz;
        return null;
    }

    @OnEvent(EventConstants.PASSIVATE)
    Object[] passivate() {
        return new Object[] { team, team.getId(), this };
    }