Re: T5 actionlink, ajax zone and user onclick handler
On Tue, Apr 29, 2008 at 9:14 AM, Chris Lewis wrote: > Unfortunately I can't think of a clean workaround for that. The issues > are all in the javascript and how events are dispatched and handled. > Basically it comes down to 2 problems: This is an old thread but found it when I run into a similar issue. > 1) The W3C does not mandate even handler ordering, so if you register a > handler before another there is no guarantee that it will actually fire > before the other. Lame. I wouldn't say it's lame, it's just the way it is. No other event system I know of would ever allow ordering event handlers. In fact, treating all handlers equally allows an option for executing them in parallel (even if current Javascript engines don't do that). > 2) Stopping the DOM event only stops it's propagation to subsequent DOM > elements and not subsequent handlers. So that means that even if you > knew your handler would fire first, stopping the event will not stop the > zone handler from firing. > Coincidentally my tests show that the mixin's JS handler is fired first, > but that's no guarantee. If it was then you could override the First of all, thanks for the well-written wiki page Chris, it's very informative. I'd think the right way to solve the problem is to use event propagation as intended. That is, in the case of confirm(), you should target the element inside of your actionlink - for example: delete Then add a handler for the nested element: Event.observe($('confirmDelete'), 'click', function(event) {if (!confirm('are you sure to delete this record ?')) event.stop();}); to stop the event from being propagated to the actionlink handler. You could probably attach the confirm mixin to an Any component outputting a span. If you put a button inside, it'd be even easier since you could just do onclick="return confirm(...);". Unfortunately it's not possible, or at least not trivial, to create a mixin that you could attach to the parent element but make it listen to a "click" event of a nested element - and I don't think it would be cool if the mixing would programmatically modify the parent element (since that's how I see you could get it done if you really wanted to). Kalle - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Help with ZoneUpdate
Em Sat, 05 Dec 2009 15:28:33 -0200, Ashwanth Kumar escreveu: Can you give me an example? I'm new to, Prototype! Regarding events, take a look at http://www.prototypejs.org/api/event/observe -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, software architect and developer, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Help with ZoneUpdate
Hey, Can you give me an example? I'm new to, Prototype! Thanks - Ashwanth Kumar On Sat, Dec 5, 2009 at 3:05 PM, Juan E. Maya wrote: > The Zone raises a JS event when is updated. This is explained in the > Zone documentation: > > > http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Zone.html > > "After the client-side content is updated, a client-side event is > fired on the zone's element. The constant Tapestry.ZONE_UPDATED_EVENT > can be used to listen to the event." > > You just need to provide a Prototype listener for that event in your page. > > On Sat, Dec 5, 2009 at 7:04 AM, Ashwanth Kumar > wrote: > > Thanks Josh, > > > > That worked like a charm!! I dont know if there could be anything better > > than this?? :) > > > > - Ashwanth Kumar > > > > > > On 12/5/09, Josh Canfield wrote: > >> > >> Last time I was hunting around for a solution for this I came up with > this: > >> > >> Tapestry.ElementEffect.myshowfunc = function(element) { > >>// do special stuff > >>return new Effect.Highlight(element); > >> } > >> > >> > >> > >> There may be a better method that I'm not aware of though. > >> > >> Josh > >> > >> On Fri, Dec 4, 2009 at 5:04 PM, Ashwanth Kumar < > ashwanth.ku...@gmail.com> > >> wrote: > >> > Hi, > >> > > >> > I've a question. How do i invoke a custom JS from the Page, > immediately > >> > after a ZoneUpate! > >> > For instance, i need to apply a markitUp on a TextArea, after it has > been > >> > created by the ZoneUpdate event in Tapestry. > >> > > >> > How do i invoke it sync with the ZoneUpdate. Currently i use the > onClick > >> > event of the TextArea to show, but its not good enough. So, asny help > >> > regarding this would be appreciated! > >> > > >> > - Ashwanth Kumar > >> > > >> > >> > >> > >> -- > >> -- > >> TheDailyTube.com. Sign up and get the best new videos on the internet > >> delivered fresh to your inbox. > >> > >> - > >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > >> For additional commands, e-mail: users-h...@tapestry.apache.org > >> > >> > > > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: T5 - MarkupWriterListener
Em Sat, 05 Dec 2009 10:55:57 -0200, Daniel Jones escreveu: Thanks for your reply Thiago. You're welcome! The mixin method would work I guess but what I'm trying to do is remove the 'name' attribute generated by the Form component (because it is not valid in the Strict Doctype). You can decorate and advise the MarkupWriterFactory service to do that. Anyway, I don't know if there's a JIRA for that alrady. If not, please post one. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, software architect and developer, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: forward to page after delay
OMG...thats so easy :jumping: Thanks a lot. Ulrich Stärk wrote: > > http://URL.of/target/page/";> > > Don't forget to provide a link in case the user's browser doesn't follow > redirects. > > Uli > > oskar_a schrieb: >> Hi, >> I m new in tapestry and try to create confirmation page A which redirects >> to >> page B after 5 seconds. Something like: "Your login was successful. Now >> You >> will be redirected to the indexpage." >> >> I tried to realize this in the onActivate() method with Thread.sleep or >> (java.util.Timer) but it doesn't woks. I takes 5 seconds to load the >> (index)page but in this time I don't see the confirmation page :( >> >> Thanks for help and sorry for my bad english. >> -- >> best regards >> Oskar > > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > > -- View this message in context: http://old.nabble.com/forward-to-page-after-delay-tp26655834p26655985.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: forward to page after delay
http://URL.of/target/page/";> Don't forget to provide a link in case the user's browser doesn't follow redirects. Uli oskar_a schrieb: Hi, I m new in tapestry and try to create confirmation page A which redirects to page B after 5 seconds. Something like: "Your login was successful. Now You will be redirected to the indexpage." I tried to realize this in the onActivate() method with Thread.sleep or (java.util.Timer) but it doesn't woks. I takes 5 seconds to load the (index)page but in this time I don't see the confirmation page :( Thanks for help and sorry for my bad english. -- best regards Oskar - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: forward to page after delay
I think the best way simpler way is to have a javascript that opens page B after X seconds. On Sat, Dec 5, 2009 at 2:54 PM, oskar_a wrote: > > Hi, > I m new in tapestry and try to create confirmation page A which redirects to > page B after 5 seconds. Something like: "Your login was successful. Now You > will be redirected to the indexpage." > > I tried to realize this in the onActivate() method with Thread.sleep or > (java.util.Timer) but it doesn't woks. I takes 5 seconds to load the > (index)page but in this time I don't see the confirmation page :( > > Thanks for help and sorry for my bad english. > -- > best regards > Oskar > -- > View this message in context: > http://old.nabble.com/forward-to-page-after-delay-tp26655834p26655834.html > Sent from the Tapestry - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
forward to page after delay
Hi, I m new in tapestry and try to create confirmation page A which redirects to page B after 5 seconds. Something like: "Your login was successful. Now You will be redirected to the indexpage." I tried to realize this in the onActivate() method with Thread.sleep or (java.util.Timer) but it doesn't woks. I takes 5 seconds to load the (index)page but in this time I don't see the confirmation page :( Thanks for help and sorry for my bad english. -- best regards Oskar -- View this message in context: http://old.nabble.com/forward-to-page-after-delay-tp26655834p26655834.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5 - MarkupWriterListener
Thanks for your reply Thiago. The mixin method would work I guess but what I'm trying to do is remove the 'name' attribute generated by the Form component (because it is not valid in the Strict Doctype). I don't want to add a mixin to every form in my application. Is there any way that I can register this with the framework when the application starts? I.e. get hold of the MarkupWriter so that I can call its setListener method? Daniel Thiago H. de Paula Figueiredo wrote: > > Em Fri, 04 Dec 2009 13:08:57 -0200, Daniel Jones > escreveu: > >> How do I register my implementation with the framework? I've tried a >> number of things in AppModule which didn't work. > > Try creating a mixin that adds your MarkupWriterListener to the > MarkupWriter in ints setupRender() method. > > -- > Thiago H. de Paula Figueiredo > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, > and instructor > Owner, software architect and developer, Ars Machina Tecnologia da > Informação Ltda. > http://www.arsmachina.com.br > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > > -- View this message in context: http://old.nabble.com/T5---MarkupWriterListener-tp26635916p26655420.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: ZoneUpdater -> null strings ...
Hi! I just copied the JumpStart example ... i.e. copied ZoneUpdater.java + ZoneUpdater.js. My html is also using jquery in noConflict() mode. My tml looks like ... .tml Currently I have added a "dummy" in my action methods which works. But it would be nice to sort it out. /Gunnar 2009/12/5 Inge Solvoll > The $N is probably a client encoding of null. > > Are you passing a context to the mixin? The provided context seems to be > [null, 'XXX'], where XXX is replaced by your real value on the client. > > On Sat, Dec 5, 2009 at 12:49 AM, Gunnar Eketrapp > wrote: > > > When I added a dummy param to my event method the field string started to > > come ... > > > > [DEBUG] pages.Register [ EXIT] onUserNameChanged [Block[Register.tml, > > line 152]] > > [DEBUG] pages.Register [ENTER] onUserNameChanged(null, "xzd") > > > > But where does the $N come from ? > > > > /Gunnar > > > > 2009/12/5 Gunnar Eketrapp > > > > > Hi! > > > > > > This is sent from my client when I pressed an 'a' in the username field > > ... > > > > > > http://localhost:8080/sv/register.username:usernamechanged/$N/a > > > > > > > > > ... and I don't understand the $N part. Could that be the problem !? > > > > > > /Gunnar > > > > > > > > > 2009/12/4 Inge Solvoll > > > > > > Hi! > > >> > > >> To begin with, use firebug to track requests sent to the server on > your > > >> keypresses. See what the urls look like, and if they contain the > strings > > >> you > > >> expect. > > >> > > >> Inge > > >> > > >> On Fri, Dec 4, 2009 at 1:26 PM, Gunnar Eketrapp > > >> wrote: > > >> > > >> > Hi and thanks for the reply! Sorry for being stupid but in the > > JumpStart > > >> > example ... > > >> > > > >> > > > http://202.177.217.122:8080/jumpstart/examples/javascript/ajaxonevent > > >> > > > >> > ... the methods below gets called for each keypress with the actual > > >> field > > >> > content. > > >> > > > >> >Object onFirstNameChanged(String firstName) { > > >> >_firstName = firstName; > > >> >return _nameZone.getBody(); > > >> >} > > >> > > > >> >Object onLastNameChanged(String lastName) { > > >> > > > >> >_lastName = lastName; > > >> >return _nameZone.getBody(); > > >> >} > > >> > > > >> > > > >> > My event methods are called for each key but are passed null > strings. > > >> > > > >> > What have I missed? > > >> > > > >> > > > >> > Here are parts of my code .. > > >> > > > >> > .tml > > >> > > > >> > > > >> > > >> > zone="usernameZone" event="usernameChanged" clientEvent="keyup" > > >> > class="formfield-wide-input" onfocus="ClearTextbox(this, > > >> > '${message:username}');" onblur="RestoreTextbox(this, > > >> > '${message:username}');" /> > > >> > > > >> > > > >> > > > >> >${usernameMessage} > > >> > > > >> > > > >> > > > >> > > >> > zone="aliasZone" event="aliasChanged" clientEvent="keyup" > > >> > class="formfield-wide-input" onfocus="ClearTextbox(this, > > >> > '${message:alias}');" onblur="RestoreTextbox(this, > > >> > '${message:alias}');" /> > > >> > > > >> > > > >> > > > >> >${aliasMessage} > > >> > > > >> > > > >> > .java > > >> > == > > >> >@Log > > >> > > > >> >Object onUserNameChanged(String userName) { > > >> >this.username = userName; > > >> >return usernameZone.getBody(); > > >> >} > > >> > > > >> >@Log > > >> >Object onAliasChanged(String alias) { > > >> >this.alias = alias; > > >> >return aliasZone.getBody(); > > >> > > > >> >} > > >> > > > >> > > > >> > /Gunnar > > >> > > > >> > > > >> > 2009/12/4 Thiago H. de Paula Figueiredo > > >> > > > >> > > Em Fri, 04 Dec 2009 08:46:31 -0200, Gunnar Eketrapp < > > >> > > gunnar.eketr...@gmail.com> escreveu: > > >> > > > > >> > > Hi! > > >> > >> > > >> > > > > >> > > Hi! > > >> > > > > >> > > I just copied Inge's ZoneUpdater and by magic my registration > page > > >> > >> startedto recieve events for each key pressed in the field that I > > had > > >> > >> instrumented with it. > > >> > >> > > >> > >> BUT by some reason the string passed is null and I must have > missed > > >> > >> something. > > >> > >> > > >> > > > > >> > > If you don't submit the form, the entered values will not be sent > to > > >> the > > >> > > page. > > >> > > > > >> > > > > >> > > When I look at the JumpStart example I noticed that the field > names > > >> have > > >> > >> underscores in them in the java class. > > >> > >> Is this needed ? > > >> > >> > > >> > > > > >> > > No. This is just a convention that some people use. > > >> > > > > >> > > -- > > >> > > Thiago H. de Paula Figueiredo > > >> > > Independent Java, Apache Tapestry 5 and Hibernate consultant, > > >> developer, > > >> > > and instructor > > >> > > Owner, software architect and developer, Ars Machina Tecnol
Re: ZoneUpdater -> null strings ...
The $N is probably a client encoding of null. Are you passing a context to the mixin? The provided context seems to be [null, 'XXX'], where XXX is replaced by your real value on the client. On Sat, Dec 5, 2009 at 12:49 AM, Gunnar Eketrapp wrote: > When I added a dummy param to my event method the field string started to > come ... > > [DEBUG] pages.Register [ EXIT] onUserNameChanged [Block[Register.tml, > line 152]] > [DEBUG] pages.Register [ENTER] onUserNameChanged(null, "xzd") > > But where does the $N come from ? > > /Gunnar > > 2009/12/5 Gunnar Eketrapp > > > Hi! > > > > This is sent from my client when I pressed an 'a' in the username field > ... > > > > http://localhost:8080/sv/register.username:usernamechanged/$N/a > > > > > > ... and I don't understand the $N part. Could that be the problem !? > > > > /Gunnar > > > > > > 2009/12/4 Inge Solvoll > > > > Hi! > >> > >> To begin with, use firebug to track requests sent to the server on your > >> keypresses. See what the urls look like, and if they contain the strings > >> you > >> expect. > >> > >> Inge > >> > >> On Fri, Dec 4, 2009 at 1:26 PM, Gunnar Eketrapp > >> wrote: > >> > >> > Hi and thanks for the reply! Sorry for being stupid but in the > JumpStart > >> > example ... > >> > > >> > > http://202.177.217.122:8080/jumpstart/examples/javascript/ajaxonevent > >> > > >> > ... the methods below gets called for each keypress with the actual > >> field > >> > content. > >> > > >> >Object onFirstNameChanged(String firstName) { > >> >_firstName = firstName; > >> >return _nameZone.getBody(); > >> >} > >> > > >> >Object onLastNameChanged(String lastName) { > >> > > >> >_lastName = lastName; > >> >return _nameZone.getBody(); > >> >} > >> > > >> > > >> > My event methods are called for each key but are passed null strings. > >> > > >> > What have I missed? > >> > > >> > > >> > Here are parts of my code .. > >> > > >> > .tml > >> > > >> > > >> > >> > zone="usernameZone" event="usernameChanged" clientEvent="keyup" > >> > class="formfield-wide-input" onfocus="ClearTextbox(this, > >> > '${message:username}');" onblur="RestoreTextbox(this, > >> > '${message:username}');" /> > >> > > >> > > >> > > >> >${usernameMessage} > >> > > >> > > >> > > >> > >> > zone="aliasZone" event="aliasChanged" clientEvent="keyup" > >> > class="formfield-wide-input" onfocus="ClearTextbox(this, > >> > '${message:alias}');" onblur="RestoreTextbox(this, > >> > '${message:alias}');" /> > >> > > >> > > >> > > >> >${aliasMessage} > >> > > >> > > >> > .java > >> > == > >> >@Log > >> > > >> >Object onUserNameChanged(String userName) { > >> >this.username = userName; > >> >return usernameZone.getBody(); > >> >} > >> > > >> >@Log > >> >Object onAliasChanged(String alias) { > >> >this.alias = alias; > >> >return aliasZone.getBody(); > >> > > >> >} > >> > > >> > > >> > /Gunnar > >> > > >> > > >> > 2009/12/4 Thiago H. de Paula Figueiredo > >> > > >> > > Em Fri, 04 Dec 2009 08:46:31 -0200, Gunnar Eketrapp < > >> > > gunnar.eketr...@gmail.com> escreveu: > >> > > > >> > > Hi! > >> > >> > >> > > > >> > > Hi! > >> > > > >> > > I just copied Inge's ZoneUpdater and by magic my registration page > >> > >> startedto recieve events for each key pressed in the field that I > had > >> > >> instrumented with it. > >> > >> > >> > >> BUT by some reason the string passed is null and I must have missed > >> > >> something. > >> > >> > >> > > > >> > > If you don't submit the form, the entered values will not be sent to > >> the > >> > > page. > >> > > > >> > > > >> > > When I look at the JumpStart example I noticed that the field names > >> have > >> > >> underscores in them in the java class. > >> > >> Is this needed ? > >> > >> > >> > > > >> > > No. This is just a convention that some people use. > >> > > > >> > > -- > >> > > Thiago H. de Paula Figueiredo > >> > > Independent Java, Apache Tapestry 5 and Hibernate consultant, > >> developer, > >> > > and instructor > >> > > Owner, software architect and developer, Ars Machina Tecnologia da > >> > > Informação Ltda. > >> > > http://www.arsmachina.com.br > >> > > > >> > > > - > >> > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > >> > > For additional commands, e-mail: users-h...@tapestry.apache.org > >> > > > >> > > > >> > > >> > > >> > -- > >> > [Hem: 08-715 59 57, Mobil: 0708-52 62 90] > >> > Allévägen 2A, 132 42 Saltsjö-Boo > >> > > >> > > > > > > > > -- > > [Hem: 08-715 59 57, Mobil: 0708-52 62 90] > > Allévägen 2A, 132 42 Saltsjö-Boo > > > > > > -- > [Hem: 08-715 59 57, Mobil: 0708-52 62 90] > Allévägen 2A, 132 42 Saltsjö-Boo >
Re: Help with ZoneUpdate
The Zone raises a JS event when is updated. This is explained in the Zone documentation: http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Zone.html "After the client-side content is updated, a client-side event is fired on the zone's element. The constant Tapestry.ZONE_UPDATED_EVENT can be used to listen to the event." You just need to provide a Prototype listener for that event in your page. On Sat, Dec 5, 2009 at 7:04 AM, Ashwanth Kumar wrote: > Thanks Josh, > > That worked like a charm!! I dont know if there could be anything better > than this?? :) > > - Ashwanth Kumar > > > On 12/5/09, Josh Canfield wrote: >> >> Last time I was hunting around for a solution for this I came up with this: >> >> Tapestry.ElementEffect.myshowfunc = function(element) { >> // do special stuff >> return new Effect.Highlight(element); >> } >> >> >> >> There may be a better method that I'm not aware of though. >> >> Josh >> >> On Fri, Dec 4, 2009 at 5:04 PM, Ashwanth Kumar >> wrote: >> > Hi, >> > >> > I've a question. How do i invoke a custom JS from the Page, immediately >> > after a ZoneUpate! >> > For instance, i need to apply a markitUp on a TextArea, after it has been >> > created by the ZoneUpdate event in Tapestry. >> > >> > How do i invoke it sync with the ZoneUpdate. Currently i use the onClick >> > event of the TextArea to show, but its not good enough. So, asny help >> > regarding this would be appreciated! >> > >> > - Ashwanth Kumar >> > >> >> >> >> -- >> -- >> TheDailyTube.com. Sign up and get the best new videos on the internet >> delivered fresh to your inbox. >> >> - >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> >> > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org