You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Angelo C." <an...@gmail.com> on 2012/07/17 07:27:36 UTC

Why the activate of another class got executed? T5.3.3

Hi,

in a package, i got some files, the first one is Register.java, if I run:

localhost:8080/info/update/123
this works, if I run
localhost:8080/info/update

Register/onActivate() will be called before Update/OnActivate(), that's
quite surprising, Am I missing something here?

Thanks,

Angelo


info/Register.java

public class Register {

    Object onActivate()  {
      	return Base.class;
    }
}


info/Update.java

public class Update {

    Object onActivate(String key)  {
			// some process
        return Base.class;
    }

    Object onActivate() {
        return Base.class;
    }
}


--
View this message in context: http://tapestry.1045711.n5.nabble.com/Why-the-activate-of-another-class-got-executed-T5-3-3-tp5714496.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Why the activate of another class got executed? T5.3.3

Posted by "Angelo C." <an...@gmail.com>.
if there is a context, the problem will not come out. when I do a :

http://localhost:8080/info/update

the onActivate() of Register will be called first before onActivate() of
Update.java. and this happens only once, if I just refresh the page, it will
not happen.


Thiago H de Paula Figueiredo wrote
> 
> On Tue, 17 Jul 2012 10:38:32 -0300, Angelo C. &lt;angelochen960@&gt;  
> wrote:
> 
>> no, i don't have. strange, one solution I can think of is, i'll create a
>> Index.java.
> 
> Isn't this another ocurrence of the assets with paths that end up matching  
> some page URL and then Tapestry considers it a request to that page?  
> What's the page activation context when the Register page onActivate() is  
> invoked?
> 
> -- 
> Thiago H. de Paula Figueiredo
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@.apache
> For additional commands, e-mail: users-help@.apache
> 


--
View this message in context: http://tapestry.1045711.n5.nabble.com/Why-the-activate-of-another-class-got-executed-T5-3-3-tp5714496p5714510.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Why the activate of another class got executed? T5.3.3

Posted by "Angelo C." <an...@gmail.com>.
Finally I believe I located the problem:
Chrome will fetch ahead pages while you are typing, say:

localhost:8080/info/u
before i finish the word update, it will show some suggestions, and in fact
it already fetch the page as I can see the logs from the terminal, switching
to Safari solves the problem.



Howard Lewis Ship wrote
> 
> Your template almost certainly has a hand-crafted, incorrect   tag in it.
> 


--
View this message in context: http://tapestry.1045711.n5.nabble.com/Why-the-activate-of-another-class-got-executed-T5-3-3-tp5714496p5714540.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Why the activate of another class got executed? T5.3.3

Posted by Howard Lewis Ship <hl...@gmail.com>.
Your template almost certainly has a hand-crafted, incorrect <img> tag in it.

On Tue, Jul 17, 2012 at 7:24 AM, Thiago H de Paula Figueiredo
<th...@gmail.com> wrote:
> On Tue, 17 Jul 2012 10:38:32 -0300, Angelo C. <an...@gmail.com>
> wrote:
>
>> no, i don't have. strange, one solution I can think of is, i'll create a
>> Index.java.
>
>
> Isn't this another ocurrence of the assets with paths that end up matching
> some page URL and then Tapestry considers it a request to that page? What's
> the page activation context when the Register page onActivate() is invoked?
>
> --
> Thiago H. de Paula Figueiredo
>
>
> ---------------------------------------------------------------------
> 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

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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


Re: Why the activate of another class got executed? T5.3.3

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Tue, 17 Jul 2012 10:38:32 -0300, Angelo C. <an...@gmail.com>  
wrote:

> no, i don't have. strange, one solution I can think of is, i'll create a
> Index.java.

Isn't this another ocurrence of the assets with paths that end up matching  
some page URL and then Tapestry considers it a request to that page?  
What's the page activation context when the Register page onActivate() is  
invoked?

-- 
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: Why the activate of another class got executed? T5.3.3

Posted by "Angelo C." <an...@gmail.com>.
no, i don't have. strange, one solution I can think of is, i'll create a
Index.java.


Lance Java wrote
> 
> Does update have a pagelink to register (in a layout perhaps?)
> 
> From jumpstart:
> When is onActivate(...) called?
> The short answer is: whenever Tapestry gets a page. It can be in response
> to a browser request. It can be when one page's java uses another.
> 


--
View this message in context: http://tapestry.1045711.n5.nabble.com/Why-the-activate-of-another-class-got-executed-T5-3-3-tp5714496p5714505.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Why the activate of another class got executed? T5.3.3

Posted by Lance Java <la...@googlemail.com>.
Does update have a pagelink to register (in a layout perhaps?)

>From jumpstart:
When is onActivate(...) called?
The short answer is: whenever Tapestry gets a page. It can be in response to
a browser request. It can be when one page's java uses another.

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Why-the-activate-of-another-class-got-executed-T5-3-3-tp5714496p5714502.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Why the activate of another class got executed? T5.3.3

Posted by "Angelo C." <an...@gmail.com>.
when I call localhost:8080/info/update, it has nothing to do with
/info/register, but register's onActivate() got called before
Update.onActivate.


Lance Java wrote
> 
> In your example, you have not show how "Register" fits into the picture.
> The code you have provided shows no link between
> "localhost:8080/info/update" and Register.
> 
> Perhaps jump start's onActivate / onPassivate explanation can help
> http://jumpstart.doublenegative.com.au/jumpstart/examples/navigation/onactivateandonpassivate/3
> 


--
View this message in context: http://tapestry.1045711.n5.nabble.com/Why-the-activate-of-another-class-got-executed-T5-3-3-tp5714496p5714499.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Why the activate of another class got executed? T5.3.3

Posted by Lance Java <la...@googlemail.com>.
In your example, you have not show how "Register" fits into the picture. The
code you have provided shows no link between "localhost:8080/info/update"
and Register.

Perhaps jump start's onActivate / onPassivate explanation can help
http://jumpstart.doublenegative.com.au/jumpstart/examples/navigation/onactivateandonpassivate/3



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Why-the-activate-of-another-class-got-executed-T5-3-3-tp5714496p5714497.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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