I met this problem before , I change the onActivatereturn type to void .
2011/2/17 Alessandro Badin
>
> Hello guys,
>
> What about I have something like this:
>
>Object onActivate() {
>condition = service.findSomething();
>return (condition == null) ? OtherPage.class : null;
Hello guys,
What about I have something like this:
Object onActivate() {
condition = service.findSomething();
return (condition == null) ? OtherPage.class : null;
}
Thanks.
Alessandro Badin
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/T5-onAct
it was a terrible typo from me. misspelled t:context :(
--
View this message in context:
http://old.nabble.com/Re%3A--T5--onActivate%2C-onPassivate-and-actionlink-tp28410121p28411519.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
How have you defined the ActionLink? It sounds like you might have set
the context parameter for it incorrectly. Can you paste your link
definition here?
cheers,
Joost
paha wrote:
Hi,
i am very new to tapestry and must be missing some important concept, need
you help. i have a page (list of
On Wed, Apr 1, 2009 at 8:33 AM, Peter Kanze wrote:
> * Maybe the onActivate is not a could place to do my doSearch(), but how can
> I do this better? Because now my search query is called twice.
> That is not what I want!
I do not use event handler methods for that: if I'm using a Grid, for
examp
Hi Geof,
Thank you!
I think I understand it better now.
The first onActivate is called when the form submits.. The second is from
the page redirected by tapestry, in my case the same page*.
* Maybe the onActivate is not a could place to do my doSearch(), but how can
I do this better? Because now
Do these help?
http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/onactivateandonpassivate/3
http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen
Regards,
Geoff
On 01/04/2009, at 9:30 PM, Peter Kanze wrote:
To b
To be more clear I added a basic page with a simple form.
See below which methods are called. Why is the onActivate() called before
the onSuccess and onSubmit()?
In my onActivate I call a doSearch(), so basically for every form submit,
the search query is called twice.
This is very inefficient. Ho
Already pointed out that this is expected. But you can bypass this
behavior.
Make your two-parameter method return "true" on successful processing;
then your 1-parameter method won't be called.
Robert
On Mar 25, 2009, at 3/256:10 AM , Peter Kanze wrote:
Hello
I have a pagelink that point t
As Andy already pointed, this is normal Tapestry behaviour.
When you have more than onActivate() method, I recommend the use of a
single method receiving an EventContext
(http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/EventContext.html):
onActivate(EventContext event) {
if
Taken from http://tapestry.apache.org/tapestry5.1/guide/event.html and should
answer your question I think.
Multiple Method Matches
In some cases, you may have multiple event methods match a single event.
The order is as follows:
* Base class methods before sub-class methods.
* Matchi
activate in a 1:1 cycle, as
posts can occur for any number of components / form events.
Cheers,
Peter
- Original Message -
From: "Thiago H. de Paula Figueiredo"
To: "Tapestry users"
Sent: Tuesday, 17 February, 2009 17:06:44 GMT +02:00 Athens, Beirut, Bucharest,
Ista
On Tue, Feb 17, 2009 at 12:02 PM, Angelo Chen
wrote:
> you need a onPassivate to persist the context on the client side if:
You need an onPassivate() method to tell Tapestry what is the
activation context for a given page. This is needed primarily because
of redirect-after-post, AFAIK, and every
Hi Thiago,
I just read again that doc, here is what I understand:
you need a onPassivate to persist the context on the client side if:
1. you have a form in the page
2. if you have an action link in the page
correct?
Angelo
Thiago H. de Paula Figueiredo wrote:
>
> On Tue, Feb 17, 2009 at 1
On Tue, Feb 17, 2009 at 10:28 AM, Angelo Chen
wrote:
> Hi Thiago,
Hi!
> I always make sure i have a onPassivate that returns same thing in the
> onActivate,
That's a good thing, returning the the save value, but not necessarily
the same type.
> now, must be wrong, what is the rule of thumb o
Hi Thiago,
I always make sure i have a onPassivate that returns same thing in the
onActivate, now, must be wrong, what is the rule of thumb on this? why we
need a onPassivate?
Thanks,
Angelo
Thiago H. de Paula Figueiredo wrote:
>
> On Tue, Feb 17, 2009 at 10:16 AM, Angelo Chen
>
> You cann
On Tue, Feb 17, 2009 at 10:16 AM, Angelo Chen
wrote:
> Hi Thiago,
Hi, Angelo!
> Thanks for the tip, never knew there is this EventContext, is following
> onPassivate correct:
You cannot return an EventContext in the onPassivate method. You don't
even need to return the same type you received
Hi Thiago,
Thanks for the tip, never knew there is this EventContext, is following
onPassivate correct:
private EventContext ec;
public Object onActivate(EventContext obj) {ec = obj;}
public EventContext onPassivate() { return ec; }
What's the advantage of using EventContext compared to O
On Tue, Feb 17, 2009 at 9:30 AM, Angelo Chen wrote:
> You are correct, in one of my javascript it has a "../images/..", i don't
> know why it got called, in that particular page, there is no reference to
> that js, commenting it out fixes the problem, but this does bring up another
> question, how
Hi,
You are correct, in one of my javascript it has a "../images/..", i don't
know why it got called, in that particular page, there is no reference to
that js, commenting it out fixes the problem, but this does bring up another
question, how to put asset:context in a javascript?
//var tb_pathTo
Most probably you're including images in your page using relative
paths. Use ${asset:context/images/loading.gif} instead and the problem
goes away. ;)
By the way, use EventContext instead of Object[] as the parameter of
your onActivate method. ;)
--
Thiago
--
btw, it is 5.0.18.
Angelo Chen wrote:
>
> Hi,
>
>
>
--
View this message in context:
http://www.nabble.com/t5%3A-onActivate-called-twice-tp22053148p22053292.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
--
What version of Tapestry? This was addressed in 5.0.14, I believe, to
ensure that when overriding a base class event handler method, the
method is not invoked twice.
On Mon, Apr 21, 2008 at 6:25 AM, Leon Derks <[EMAIL PROTECTED]> wrote:
> Hi Davor,
>
> Indeed, I have a BasePage that implements th
Hi Leon,
I am facing the same problem with the onActivate() method calling twice.
Did you find any solution for this?
Thanks,
Yees.
-Original Message-
From: Leon Derks [mailto:[EMAIL PROTECTED]
Sent: Monday, April 21, 2008 6:56 PM
To: Tapestry users
Subject: Re: T5: onActivate
i think that solution is a bit "dangerous",
if you do some refectorings.
eg: move the page Administration in another package
or the application context is changed
2008/8/29 <[EMAIL PROTECTED]>
> Hi,
>
> I was just about to reply and say I solved it. Missing slash in the
> location.href. The fol
Hi,
I was just about to reply and say I solved it. Missing slash in the
location.href. The following works:
onclick="location.href='/Administration';"/>
thanks for your help.
p.
Quoting Martijn Brinkers <[EMAIL PROTECTED]>:
I'm not sure but I thinks it's a similar problem. It looks l
I'm not sure but I thinks it's a similar problem. It looks like
Administration is interpreted as the context.
If you want to cancel the page it's easier to use the t5Component Button
component.
Add t5Component jar to you project (see
http://code.google.com/p/tapestry5-components/) and add this to
Em Fri, 29 Aug 2008 07:23:48 -0300, <[EMAIL PROTECTED]> escreveu:
Something that works wonderfully with any kind of resource (imagens, CSS,
etc) is to use the asset prefix:
alt="bl" />
It works regardless of where your template is and what URL it has.
Thiago
--
Thanks for the fast reply Martijn; that fixed the GIF asset.
However, I am still having problems with the Cancel button. I can
reference the Administration page as an asset, but obviously it then
does not get processed by Tapestry.
Thoughts, anyone?
p.
Quoting Martijn Brinkers <[EMAI
I think the following happens
The gif is requested by your page because of the IMG so the GET for the
IMG looks something like
http://YOUR_DOMAIN/YOUR_PAGE/bl_red_hundred.gif
Now you page assumes this is your activation context and tries to
convert it to int (which it's not).
I think you can so
Before 5.0.13, if onActivate() appeared in a subclass and its parent,
Tapestry used to jump in and call both. From 5.0.13 it seems to
follow the normal Java convention, ie. only the subclass method is
called, so it is up to the subclass to call the parent if that's what
you want. I ran a
Em Sun, 22 Jun 2008 04:09:30 -0300, Geoff Callender
<[EMAIL PROTECTED]> escreveu:
Furthermore, since T5.0.13, the parent class's onActivate() is no longer
called if it's been overridden in the child class (see
https://issues.apache.org/jira/browse/TAPESTRY-2311 ). Now you must
ensure the
Furthermore, since T5.0.13, the parent class's onActivate() is no
longer called if it's been overridden in the child class (see https://issues.apache.org/jira/browse/TAPESTRY-2311
). Now you must ensure the child class's onActivate() calls
super.onActivate(), or else the security is lost. T
Hi,
Both PageRenderRequestFilter and ComponentEventRequestFilter receives a
context that includes the page name. Why not use that?
The following post might be of use:
http://www.mail-archive.com/users@tapestry.apache.org/msg21568.html
-Filip
Ned Jackson Lovely skrev:
On Sun, Jun 8, 2008 at
On Sun, Jun 8, 2008 at 5:00 AM, maxthesecond <[EMAIL PROTECTED]> wrote:
> As for loggin the request-filter option is very attractive, all that crap in
> just one place.
I've been wondering about the request filter... To determine which
page is being accessed, I've been parsing the path myself, usi
Thanks Fernando, I came up with the same conclusion regarding onActivate just
for parameters and also just an array of objects in case i need more than
one.
As for loggin the request-filter option is very attractive, all that crap in
just one place.
And finally the beginrender and onprepareform I
I just read the tail end of the conversation, but I wanted to add something.
I try to use onActivate to capture parameters from the url, and maybe do
minimal translation/validation of those inputs. But I do the actual
work within the setupRender. That way it doesn't matter how many
onActivat
Glad to know there is consensus about it ,I'll check the RequestFilter and
let the onActivate for the page tasks (reloading objects.)
Thanks
--
View this message in context:
http://www.nabble.com/T5-onActivate-tp17673637p17710792.html
Sent from the Tapestry - User mailing list archive at Nab
I have to agree with Filip and I'll state it a bit more strongly: if you
are using onActivate for access control your app will suffer from
significant maintenance issues that will only get worse and more complex
with each page you add, and even nastier if your access control logic's
requirements ev
That's a good point Filters...I'll think about it, unfortunatelly for me I've
been influenced by many samples where onactivate is used for the purpose I
do, in fact I begin the issue saying that I can't full understand the page
cicle model. From the semantical point of view onActivate seems to imp
Hi,
The documentation clearly states that they will all be called as well as
the order they will be called in.
I don't check login etc. in onActivate, I use request filters for that.
But it's your app, not mine, so do as you please. :)
-Filip
On 2008-06-07 12:58, maxthesecond wrote:
Well,
Well, in my case when I have two or more onActivate handlers I've seen all
them called one after the other wich of course is not what I expect ,besides
the fact of having just one onActivate frees you of having to check common
isues like for example loggin , or administrative rights in many places
Hi,
I frequently have multiple onActivate methods as well. Tapestry will
look at the context and see how many parameters there are - let's say
there are n parameters. It will then call the method with n parameters -
or if none can be found, the one with n-1 parameters, then n-2
parameters and
Renat Zubairov wrote:
>
> Why would you need to have multiple parameters in onActivate? Are you
> considering using Encoder?
> http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry/PrimaryKeyEncoder.html
>
Well, it is simply an Update/Create page of a detail element belonging to a
Why would you need to have multiple parameters in onActivate? Are you
considering using Encoder?
http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry/PrimaryKeyEncoder.html
2008/6/6 maxthesecond <[EMAIL PROTECTED]>:
>
> At the moment my conclusion is that to deal with multiple onActiva
At the moment my conclusion is that to deal with multiple onActivate
parameters you should encompass them in an Object[], and then make your
control in just one onActivate(Object[] o) method, the drawback is that it
forces you to write metods for setting the parameters properties.
Strangelly if y
Solved
The isue was that images where build up on the client side and where asigned
the baseURI+imagedirectory, as the baseURI now contains many more items the
result points far away where the images are .
to solve it I just write
String
s=img.baseURI.substring(0,img.baseURI.indexOf("app")+4)+"
Yes there was an image
I use the tree component found in
http://wiki.apache.org/tapestry/Tapestry5HowToCreateYourOwnComponents
In it, there is a javascript in which two icons are used the tipical + and -
icons to represent opened and closed folders, those icons are aded on the
window.onlo
Hi Davor,
Indeed, I have a BasePage that implements the public void onActivate()
{}method.
In my subpage I also have implemented the public void onActivate() {}.
The code in onActivate() of my subpage is executed twice.
BASEPAGE:
public void onActivate() {
String pageName = resources.g
you have to be more specific,
same OnActivate method will not be called more than once in normal
circumastances,
but overriding onActivate from a base class I belive can cause this ...
some code would be useful.
Davor Hrg
On Mon, Apr 21, 2008 at 12:41 PM, Leon Derks <[EMAIL PROTECTED]> wrote:
Yes it does, if the onActivate() methods are in different places.
There's a very explicit order, base classes handle events before
subclasses. Within a class, its handled alphabetically (ascending)
and by parameter count (descending, for a single method name with
multiple overrides).
What you may
Howard,
I'm on 5.0.6. I'll try to boil this down to a simple test case and file
a JIRA. It might have something to do with the page inheritance I'm
using? ThisPage -> EditBasePage -> BasePage. The onActivate() and
onActivate(Integer) methods are on ThisPage. Would this make a
difference?
Tha
Please add to JIRA.
On Nov 24, 2007 9:09 PM, Andy Huhn <[EMAIL PROTECTED]> wrote:
> Hi Howard,
>
> I am on 5.0.6. The behavior you described here is what I expected to
> see (I have onActivate() with one parameter, and onActivate() with 0
> parameters, and I expected to see onActivate() with one
Hi Howard,
I am on 5.0.6. The behavior you described here is what I expected to
see (I have onActivate() with one parameter, and onActivate() with 0
parameters, and I expected to see onActivate() with one parameter
executed first...but that was not the case).
Should I file a JIRA? It sounds lik
You are using 5.0.5? I believe 5.0.6 has a fix for this, wherein the
method invocation order is by number of parameters, decreasing.
You may have to do:
Object onActivate(Object[] context)
{
...
}
And check the context count explicitly, and convert the context values
explicitly, if you are on
The onActivate(Object[]) solution works well, thanks.
I've opened an enhancement request in JIRA to track this change, too:
https://issues.apache.org/jira/browse/TAPESTRY-1295
On 2/23/07, Howard Lewis Ship <[EMAIL PROTECTED]> wrote:
Yes, this is tricky and I'm thinking I'm not happy with the
Yes, this is tricky and I'm thinking I'm not happy with the way it
currently works.
Your best option is to implement onActivate(Object[]) and do any
coercions from there. This will be invoked regardless of the number
of values in the context (even zero).
I'm thinking the change will be: a meth
57 matches
Mail list logo