Re: T5: onActivate called before onSuccessFrom

2011-02-24 Thread jqzone
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;

Re: T5: onActivate called before onSuccessFrom

2011-02-17 Thread Alessandro Badin
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

Re: [T5] onActivate, onPassivate and actionlink

2010-04-30 Thread paha
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.

Re: [T5] onActivate, onPassivate and actionlink

2010-04-30 Thread Joost Schouten (ml)
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

Re: T5: onActivate called before onSuccessFrom

2009-04-01 Thread Thiago H. de Paula Figueiredo
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

Re: T5: onActivate called before onSuccessFrom

2009-04-01 Thread Peter Kanze
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

Re: T5: onActivate called before onSuccessFrom

2009-04-01 Thread Geoff Callender
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

Re: T5: onActivate called before onSuccessFrom

2009-04-01 Thread Peter Kanze
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

Re: T5: onActivate called twice

2009-03-25 Thread Robert Zeigler
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

Re: T5: onActivate called twice

2009-03-25 Thread Thiago H. de Paula Figueiredo
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

RE: T5: onActivate called twice

2009-03-25 Thread Blower, Andy
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

Re: t5: onActivate called twice

2009-02-17 Thread Peter Stavrinides
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

Re: t5: onActivate called twice

2009-02-17 Thread Thiago H. de Paula Figueiredo
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

Re: t5: onActivate called twice

2009-02-17 Thread Angelo Chen
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

Re: t5: onActivate called twice

2009-02-17 Thread Thiago H. de Paula Figueiredo
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

Re: t5: onActivate called twice

2009-02-17 Thread Angelo Chen
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

Re: t5: onActivate called twice

2009-02-17 Thread Thiago H. de Paula Figueiredo
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

Re: t5: onActivate called twice

2009-02-17 Thread Angelo Chen
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

Re: t5: onActivate called twice

2009-02-17 Thread Thiago H. de Paula Figueiredo
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

Re: t5: onActivate called twice

2009-02-17 Thread Angelo Chen
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

Re: t5: onActivate called twice

2009-02-17 Thread Thiago H. de Paula Figueiredo
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 --

Re: t5: onActivate called twice

2009-02-17 Thread Angelo Chen
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. --

Re: T5: onActivate() called twice

2008-09-09 Thread Howard Lewis Ship
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

RE: T5: onActivate() called twice

2008-09-09 Thread Yeeswara Nadapana (HCL Financial Services)
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

Re: T5: onActivate exception query

2008-08-29 Thread Sven Homburg
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

Re: T5: onActivate exception query

2008-08-29 Thread photos
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

Re: T5: onActivate exception query

2008-08-29 Thread Martijn Brinkers
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

Re: T5: onActivate exception query

2008-08-29 Thread Thiago H. de Paula Figueiredo
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 --

Re: T5: onActivate exception query

2008-08-29 Thread photos
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

Re: T5: onActivate exception query

2008-08-29 Thread Martijn Brinkers
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

Re: T5 onActivate

2008-06-23 Thread Geoff Callender
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

Re: T5 onActivate

2008-06-22 Thread Thiago H. de Paula Figueiredo
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

Re: T5 onActivate

2008-06-22 Thread Geoff Callender
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

Re: T5 onActivate

2008-06-10 Thread Filip S. Adamsen
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

Re: T5 onActivate

2008-06-10 Thread Ned Jackson Lovely
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

Re: T5 onActivate

2008-06-08 Thread maxthesecond
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

Re: T5 onActivate

2008-06-07 Thread Fernando Padilla
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

Re: T5 onActivate

2008-06-07 Thread maxthesecond
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

Re: T5 onActivate

2008-06-07 Thread Chris Lewis
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

Re: T5 onActivate

2008-06-07 Thread maxthesecond
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

Re: T5 onActivate

2008-06-07 Thread Filip S. Adamsen
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,

Re: T5 onActivate

2008-06-07 Thread maxthesecond
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

Re: T5 onActivate

2008-06-07 Thread Filip S. Adamsen
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

Re: T5 onActivate

2008-06-07 Thread maxthesecond
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

Re: T5 onActivate

2008-06-06 Thread Renat Zubairov
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

Re: T5 onActivate

2008-06-06 Thread maxthesecond
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

Re: T5 OnActivate

2008-06-02 Thread maxthesecond
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)+"

Re: T5 OnActivate

2008-06-01 Thread maxthesecond
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

Re: T5: onActivate() called twice

2008-04-21 Thread Leon Derks
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

Re: T5: onActivate() called twice

2008-04-21 Thread Davor Hrg
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:

Re: T5: onActivate woes

2007-11-27 Thread Howard Lewis Ship
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

Re: T5: onActivate woes

2007-11-26 Thread Andy Huhn
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

Re: T5: onActivate woes

2007-11-25 Thread Howard Lewis Ship
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

Re: T5: onActivate woes

2007-11-24 Thread Andy Huhn
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

Re: T5: onActivate woes

2007-11-24 Thread Howard Lewis Ship
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

Re: T5: onActivate error handling?

2007-02-23 Thread D&J Gredler
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

Re: T5: onActivate error handling?

2007-02-23 Thread Howard Lewis Ship
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