Validate annotation on field
Hi, I want to use the @Validate annotation, but I cannot put it at the value properties, because these properties are part of a DTO object that is part of a library. In the documentation (http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/beaneditor/Validate.html) I found the following: " May be placed on any getter or setter method, or on the matching field". So I thought I could do the following: @Validate("regexp="+SOME_REGEXP) @InjectComponent private Field someField; But this does not seem to work? Is there any other way to add validators to a field programatically when you have no access to the property declarations? I could do all validation myself in the onValidate event, but this does not seem optimal. Nathan - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: JS call on AJAX zone update
Thank You Chris. This is exactly what I ended up doing :) On Thu, Sep 15, 2016 at 11:08 AM, Chris Poulsen wrote: > You did not specify whether it was a specific zone / zoneupdate you wanted > to react on as opposed to all on page. Hence binding a listener on the > document seemed like a good suggestion. > > You should avoid using JS directly in the page (like in your example) - Use > modules instead. > > For reference such a module could look like this: > > (function() > { > define( [ "t5/core/dom", "t5/core/events" ], function( dom, events ) > { > dom.onDocument(events.zone.didUpdate, function() { > alert( 'updated' ); > }); > > return null; > } ); > > } ).call( this ) > > On Thu, Sep 15, 2016 at 10:38 AM, Adam X wrote: > >> I was able to do this with an ajax renderer callback. This example >> helped me: http://jumpstart.doublenegative.com.au/jumpstart7/examples/ >> javascript/modal/1 >> >> Thanks! >> >> On Thu, Sep 15, 2016 at 10:13 AM, Adam X wrote: >> > Thanks for that pointer. But I'm no javascript expert. I tried the >> > following two attempts, neither worked: >> > >> > >> > $('#myZone').on("t5:zone:update",function(){ >> > alert('changed'); >> > }); >> > >> > >> > Is there something obvious that I'm doing wrong? >> > >> > >> > $("#myZone").change(function() { >> > alert('changed'); >> > }); >> > >> > >> > Adam >> > >> > On Thu, Sep 15, 2016 at 10:01 AM, Chris Poulsen >> wrote: >> >> Take a look at >> >> http://tapestry.apache.org/current/coffeescript/events.html#section-16 >> to >> >> see which events to listen for >> >> >> >> On Thu, Sep 15, 2016 at 9:40 AM, Adam X wrote: >> >> >> >>> Hi, >> >>> >> >>> I know I'm missing something, but what's the easiest, cleanest >> >>> Tapestry way to hook a JS function whenever zone is updated via AJAX? >> >>> >> >>> For example, something simple like: alert('zone updated'); >> >>> >> >>> Adam >> >>> >> >>> - >> >>> 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 >> >> - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: JS call on AJAX zone update
You did not specify whether it was a specific zone / zoneupdate you wanted to react on as opposed to all on page. Hence binding a listener on the document seemed like a good suggestion. You should avoid using JS directly in the page (like in your example) - Use modules instead. For reference such a module could look like this: (function() { define( [ "t5/core/dom", "t5/core/events" ], function( dom, events ) { dom.onDocument(events.zone.didUpdate, function() { alert( 'updated' ); }); return null; } ); } ).call( this ) On Thu, Sep 15, 2016 at 10:38 AM, Adam X wrote: > I was able to do this with an ajax renderer callback. This example > helped me: http://jumpstart.doublenegative.com.au/jumpstart7/examples/ > javascript/modal/1 > > Thanks! > > On Thu, Sep 15, 2016 at 10:13 AM, Adam X wrote: > > Thanks for that pointer. But I'm no javascript expert. I tried the > > following two attempts, neither worked: > > > > > > $('#myZone').on("t5:zone:update",function(){ > > alert('changed'); > > }); > > > > > > Is there something obvious that I'm doing wrong? > > > > > > $("#myZone").change(function() { > > alert('changed'); > > }); > > > > > > Adam > > > > On Thu, Sep 15, 2016 at 10:01 AM, Chris Poulsen > wrote: > >> Take a look at > >> http://tapestry.apache.org/current/coffeescript/events.html#section-16 > to > >> see which events to listen for > >> > >> On Thu, Sep 15, 2016 at 9:40 AM, Adam X wrote: > >> > >>> Hi, > >>> > >>> I know I'm missing something, but what's the easiest, cleanest > >>> Tapestry way to hook a JS function whenever zone is updated via AJAX? > >>> > >>> For example, something simple like: alert('zone updated'); > >>> > >>> Adam > >>> > >>> - > >>> 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: JS call on AJAX zone update
I was able to do this with an ajax renderer callback. This example helped me: http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/modal/1 Thanks! On Thu, Sep 15, 2016 at 10:13 AM, Adam X wrote: > Thanks for that pointer. But I'm no javascript expert. I tried the > following two attempts, neither worked: > > > $('#myZone').on("t5:zone:update",function(){ > alert('changed'); > }); > > > Is there something obvious that I'm doing wrong? > > > $("#myZone").change(function() { > alert('changed'); > }); > > > Adam > > On Thu, Sep 15, 2016 at 10:01 AM, Chris Poulsen > wrote: >> Take a look at >> http://tapestry.apache.org/current/coffeescript/events.html#section-16 to >> see which events to listen for >> >> On Thu, Sep 15, 2016 at 9:40 AM, Adam X wrote: >> >>> Hi, >>> >>> I know I'm missing something, but what's the easiest, cleanest >>> Tapestry way to hook a JS function whenever zone is updated via AJAX? >>> >>> For example, something simple like: alert('zone updated'); >>> >>> Adam >>> >>> - >>> 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: JS call on AJAX zone update
Thanks for that pointer. But I'm no javascript expert. I tried the following two attempts, neither worked: $('#myZone').on("t5:zone:update",function(){ alert('changed'); }); Is there something obvious that I'm doing wrong? $("#myZone").change(function() { alert('changed'); }); Adam On Thu, Sep 15, 2016 at 10:01 AM, Chris Poulsen wrote: > Take a look at > http://tapestry.apache.org/current/coffeescript/events.html#section-16 to > see which events to listen for > > On Thu, Sep 15, 2016 at 9:40 AM, Adam X wrote: > >> Hi, >> >> I know I'm missing something, but what's the easiest, cleanest >> Tapestry way to hook a JS function whenever zone is updated via AJAX? >> >> For example, something simple like: alert('zone updated'); >> >> Adam >> >> - >> 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: JS call on AJAX zone update
Take a look at http://tapestry.apache.org/current/coffeescript/events.html#section-16 to see which events to listen for On Thu, Sep 15, 2016 at 9:40 AM, Adam X wrote: > Hi, > > I know I'm missing something, but what's the easiest, cleanest > Tapestry way to hook a JS function whenever zone is updated via AJAX? > > For example, something simple like: alert('zone updated'); > > Adam > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
JS call on AJAX zone update
Hi, I know I'm missing something, but what's the easiest, cleanest Tapestry way to hook a JS function whenever zone is updated via AJAX? For example, something simple like: alert('zone updated'); Adam - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org