You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by tapestry5 <bi...@gmail.com> on 2008/07/24 18:13:44 UTC

void onActivate(String ,String)

When ever i use onActivate in my tapestry page i see that it is called
multiple times.  

I am using onActivate(String ,String).

In first instance it will take the right value and in the second instance it
will replace the last value with my resource folder names.

eg: 1st time when OnActivation(String _val1, String _val2) is called the
value was test1/test2
2nd time when OnActivation(String _val1, String _val2) is called the value
was test1/images
3rd time when OnActivation(String _val1, String _val2) is called the value
was test1/js

I am not sure why this is happening.

Is it that i am calling a wrong method?
Any help??
-- 
View this message in context: http://www.nabble.com/void-onActivate%28String-%2CString%29-tp18635295p18635295.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: void onActivate(String ,String)

Posted by Padawn <bk...@comcast.net>.
Event bubbling?  In 5.0.13 I have a page with two onActivate()'s, both of
which will get invoked.

.java
  1.  void onActivate(Object[] projectContext) {..} // pagelink handler with
a context of two Long ids
  2.  void onActivate(Long taskId) { ... }              // pagelink handler
with standard persistent id of object to edit

If coded such that neither handler throws an exception [purposefully], both
will always be invoked.  To use the two methods, I had to change the return
type to boolean and add this code to handler #1: 
		// It's an Edit
		if (projectContext.length != 2) {
			return Boolean.FALSE;
		} 

which allows onActivate(Long taskId) {..} to be invoked.  And

               // Handle the Add with context
               ...
              return Boolean.TRUE;

which short-circuits the processing so the onActivate(Long taskId) does NOT
get invoked.  
Not knowledgeable enough to explain why, just a FWIW from a behavior
perspective.  My guess is that since the multi-param onActivate(..) handler
exists, the magic part of Tapestry is consuming what it sees as arguments
until none are left, or the least common denominator method(argument) is
invoked.







-- 
View this message in context: http://www.nabble.com/void-onActivate%28String-%2CString%29-tp18635295p18639005.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: void onActivate(String ,String)

Posted by Jonathan Barker <jo...@gmail.com>.
I switched over to using Assets and then in the page/component class using
@Inject 
	@Path("context:/images/Logo.gif")
	@Property(read=true)
	private Asset _logo;

 
> -----Original Message-----
> From: tapestry5 [mailto:bishtamrita@gmail.com]
> Sent: Thursday, July 24, 2008 14:51
> To: users@tapestry.apache.org
> Subject: Re: void onActivate(String ,String)
> 
> 
> I tried changing path but it still gives me same values
> 
> 
> joshcanfield wrote:
> >
> > Look at the html that your page is generating. Your image/js paths are
> > probably relative to the page.
> >
> > You probably have:
> >  images/myimage.jpg
> > you want
> >  /images/myimage.jpg
> > Josh
> > On Thu, Jul 24, 2008 at 9:13 AM, tapestry5 <bi...@gmail.com>
> wrote:
> >
> >>
> >> When ever i use onActivate in my tapestry page i see that it is called
> >> multiple times.
> >>
> >> I am using onActivate(String ,String).
> >>
> >> In first instance it will take the right value and in the second
> instance
> >> it
> >> will replace the last value with my resource folder names.
> >>
> >> eg: 1st time when OnActivation(String _val1, String _val2) is called
> the
> >> value was test1/test2
> >> 2nd time when OnActivation(String _val1, String _val2) is called the
> >> value
> >> was test1/images
> >> 3rd time when OnActivation(String _val1, String _val2) is called the
> >> value
> >> was test1/js
> >>
> >> I am not sure why this is happening.
> >>
> >> Is it that i am calling a wrong method?
> >> Any help??
> >> --
> >> View this message in context:
> >> http://www.nabble.com/void-onActivate%28String-%2CString%29-
> tp18635295p18635295.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
> >>
> >>
> >
> >
> > --
> > --
> > TheDailyTube.com. Sign up and get the best new videos on the internet
> > delivered fresh to your inbox.
> >
> >
> 
> --
> View this message in context: http://www.nabble.com/void-
> onActivate%28String-%2CString%29-tp18635295p18638141.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


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


Re: void onActivate(String ,String)

Posted by Josh Canfield <jo...@thedailytube.com>.
Phew, that's good. I was thinking it might be something harder :)

On Thu, Jul 24, 2008 at 1:33 PM, tapestry5 <bi...@gmail.com> wrote:

>
> You are right.
>
> I changed the url in the css links and script links but missed to change in
> the links of images.
>
> Its working now.
>
> Thanks.
>
>
>
> joshcanfield wrote:
> >
> > show us the urls generated for your page and the urls generated for the
> > images.
> >
> > On Thu, Jul 24, 2008 at 11:51 AM, tapestry5 <bi...@gmail.com>
> wrote:
> >
> >>
> >> I tried changing path but it still gives me same values
> >>
> >>
> >> joshcanfield wrote:
> >> >
> >> > Look at the html that your page is generating. Your image/js paths are
> >> > probably relative to the page.
> >> >
> >> > You probably have:
> >> >  images/myimage.jpg
> >> > you want
> >>  >  /images/myimage.jpg
> >> > Josh
> >> > On Thu, Jul 24, 2008 at 9:13 AM, tapestry5 <bi...@gmail.com>
> >> wrote:
> >> >
> >> >>
> >> >> When ever i use onActivate in my tapestry page i see that it is
> called
> >> >> multiple times.
> >> >>
> >> >> I am using onActivate(String ,String).
> >> >>
> >> >> In first instance it will take the right value and in the second
> >> instance
> >> >> it
> >> >> will replace the last value with my resource folder names.
> >> >>
> >> >> eg: 1st time when OnActivation(String _val1, String _val2) is called
> >> the
> >> >> value was test1/test2
> >> >> 2nd time when OnActivation(String _val1, String _val2) is called the
> >> >> value
> >> >> was test1/images
> >> >> 3rd time when OnActivation(String _val1, String _val2) is called the
> >> >> value
> >> >> was test1/js
> >> >>
> >> >> I am not sure why this is happening.
> >> >>
> >> >> Is it that i am calling a wrong method?
> >> >> Any help??
> >> >> --
> >> >> View this message in context:
> >> >>
> >>
> http://www.nabble.com/void-onActivate%28String-%2CString%29-tp18635295p18635295.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
> >> >>
> >> >>
> >> >
> >> >
> >> > --
> >> > --
> >> > TheDailyTube.com. Sign up and get the best new videos on the internet
> >> > delivered fresh to your inbox.
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/void-onActivate%28String-%2CString%29-tp18635295p18638141.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
> >>
> >>
> >
> >
> > --
> > --
> > TheDailyTube.com. Sign up and get the best new videos on the internet
> > delivered fresh to your inbox.
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/void-onActivate%28String-%2CString%29-tp18635295p18639492.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
>
>


-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

Re: void onActivate(String ,String)

Posted by tapestry5 <bi...@gmail.com>.
You are right. 

I changed the url in the css links and script links but missed to change in
the links of images.

Its working now. 

Thanks.



joshcanfield wrote:
> 
> show us the urls generated for your page and the urls generated for the
> images.
> 
> On Thu, Jul 24, 2008 at 11:51 AM, tapestry5 <bi...@gmail.com> wrote:
> 
>>
>> I tried changing path but it still gives me same values
>>
>>
>> joshcanfield wrote:
>> >
>> > Look at the html that your page is generating. Your image/js paths are
>> > probably relative to the page.
>> >
>> > You probably have:
>> >  images/myimage.jpg
>> > you want
>>  >  /images/myimage.jpg
>> > Josh
>> > On Thu, Jul 24, 2008 at 9:13 AM, tapestry5 <bi...@gmail.com>
>> wrote:
>> >
>> >>
>> >> When ever i use onActivate in my tapestry page i see that it is called
>> >> multiple times.
>> >>
>> >> I am using onActivate(String ,String).
>> >>
>> >> In first instance it will take the right value and in the second
>> instance
>> >> it
>> >> will replace the last value with my resource folder names.
>> >>
>> >> eg: 1st time when OnActivation(String _val1, String _val2) is called
>> the
>> >> value was test1/test2
>> >> 2nd time when OnActivation(String _val1, String _val2) is called the
>> >> value
>> >> was test1/images
>> >> 3rd time when OnActivation(String _val1, String _val2) is called the
>> >> value
>> >> was test1/js
>> >>
>> >> I am not sure why this is happening.
>> >>
>> >> Is it that i am calling a wrong method?
>> >> Any help??
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/void-onActivate%28String-%2CString%29-tp18635295p18635295.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
>> >>
>> >>
>> >
>> >
>> > --
>> > --
>> > TheDailyTube.com. Sign up and get the best new videos on the internet
>> > delivered fresh to your inbox.
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/void-onActivate%28String-%2CString%29-tp18635295p18638141.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
>>
>>
> 
> 
> -- 
> --
> TheDailyTube.com. Sign up and get the best new videos on the internet
> delivered fresh to your inbox.
> 
> 

-- 
View this message in context: http://www.nabble.com/void-onActivate%28String-%2CString%29-tp18635295p18639492.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: void onActivate(String ,String)

Posted by Josh Canfield <jo...@thedailytube.com>.
show us the urls generated for your page and the urls generated for the
images.

On Thu, Jul 24, 2008 at 11:51 AM, tapestry5 <bi...@gmail.com> wrote:

>
> I tried changing path but it still gives me same values
>
>
> joshcanfield wrote:
> >
> > Look at the html that your page is generating. Your image/js paths are
> > probably relative to the page.
> >
> > You probably have:
> >  images/myimage.jpg
> > you want
>  >  /images/myimage.jpg
> > Josh
> > On Thu, Jul 24, 2008 at 9:13 AM, tapestry5 <bi...@gmail.com>
> wrote:
> >
> >>
> >> When ever i use onActivate in my tapestry page i see that it is called
> >> multiple times.
> >>
> >> I am using onActivate(String ,String).
> >>
> >> In first instance it will take the right value and in the second
> instance
> >> it
> >> will replace the last value with my resource folder names.
> >>
> >> eg: 1st time when OnActivation(String _val1, String _val2) is called the
> >> value was test1/test2
> >> 2nd time when OnActivation(String _val1, String _val2) is called the
> >> value
> >> was test1/images
> >> 3rd time when OnActivation(String _val1, String _val2) is called the
> >> value
> >> was test1/js
> >>
> >> I am not sure why this is happening.
> >>
> >> Is it that i am calling a wrong method?
> >> Any help??
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/void-onActivate%28String-%2CString%29-tp18635295p18635295.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
> >>
> >>
> >
> >
> > --
> > --
> > TheDailyTube.com. Sign up and get the best new videos on the internet
> > delivered fresh to your inbox.
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/void-onActivate%28String-%2CString%29-tp18635295p18638141.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
>
>


-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

Re: void onActivate(String ,String)

Posted by tapestry5 <bi...@gmail.com>.
I tried changing path but it still gives me same values


joshcanfield wrote:
> 
> Look at the html that your page is generating. Your image/js paths are
> probably relative to the page.
> 
> You probably have:
>  images/myimage.jpg 
> you want
>  /images/myimage.jpg 
> Josh
> On Thu, Jul 24, 2008 at 9:13 AM, tapestry5 <bi...@gmail.com> wrote:
> 
>>
>> When ever i use onActivate in my tapestry page i see that it is called
>> multiple times.
>>
>> I am using onActivate(String ,String).
>>
>> In first instance it will take the right value and in the second instance
>> it
>> will replace the last value with my resource folder names.
>>
>> eg: 1st time when OnActivation(String _val1, String _val2) is called the
>> value was test1/test2
>> 2nd time when OnActivation(String _val1, String _val2) is called the
>> value
>> was test1/images
>> 3rd time when OnActivation(String _val1, String _val2) is called the
>> value
>> was test1/js
>>
>> I am not sure why this is happening.
>>
>> Is it that i am calling a wrong method?
>> Any help??
>> --
>> View this message in context:
>> http://www.nabble.com/void-onActivate%28String-%2CString%29-tp18635295p18635295.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
>>
>>
> 
> 
> -- 
> --
> TheDailyTube.com. Sign up and get the best new videos on the internet
> delivered fresh to your inbox.
> 
> 

-- 
View this message in context: http://www.nabble.com/void-onActivate%28String-%2CString%29-tp18635295p18638141.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: void onActivate(String ,String)

Posted by Josh Canfield <jo...@thedailytube.com>.
Look at the html that your page is generating. Your image/js paths are
probably relative to the page.

You probably have:
<img src="images/myimage.jpg"/>
you want
<img src="/images/myimage.jpg"/>
Josh
On Thu, Jul 24, 2008 at 9:13 AM, tapestry5 <bi...@gmail.com> wrote:

>
> When ever i use onActivate in my tapestry page i see that it is called
> multiple times.
>
> I am using onActivate(String ,String).
>
> In first instance it will take the right value and in the second instance
> it
> will replace the last value with my resource folder names.
>
> eg: 1st time when OnActivation(String _val1, String _val2) is called the
> value was test1/test2
> 2nd time when OnActivation(String _val1, String _val2) is called the value
> was test1/images
> 3rd time when OnActivation(String _val1, String _val2) is called the value
> was test1/js
>
> I am not sure why this is happening.
>
> Is it that i am calling a wrong method?
> Any help??
> --
> View this message in context:
> http://www.nabble.com/void-onActivate%28String-%2CString%29-tp18635295p18635295.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
>
>


-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

Re: void onActivate(String ,String)

Posted by Marcus <mv...@gmail.com>.
Hi,

Seach on this list for:
t5 "redirect after post"

Tapestry uses redirect-after-post design.
http://www.theserverside.com/tt/articles/article.tss?l=RedirectAfterPost

Marcus