[Seaside] ajax onBlur callback with load html: [...]

gettimothy gettimothy at zoho.com
Tue Sep 21 15:48:16 UTC 2021


do you have a stack overflow area for this?





---- On Tue, 21 Sep 2021 11:21:31 -0400 Bob Nemec <bobn at rogers.com> wrote ----


For some reason I am no longer getting these emails. (I'd really like to move this mailing list to better forum, like a Google Group or questions on Stack Overflow). 

Found this from Joachim in the archive...

...we had to register an event handler with the doument using an 
extra selector. in Javascript you'd have to do it like this:

$(document).on("click","button#idOfTheButton", function(event) {...} );  
(see https://api.jquery.com/on/ <https://api.jquery.com/on/> for details)



In Seaside, this would look like this:


     (html jQuery document)
                 on: 'blur'
                 selector: '#myButton'
                 do: (
                     (html jQuery ajax) ....


...I tried that, but if I include the button render in the reloaded div, with the on:selector:do: outside of the reloaded div, I get the same symptom: the 'click' (changed from 'blur') event does not consistently fire, as if the selector did not find the button. Adding console.log() tracing shows the occasional absence of the button onClick event. 

Seems that the rule for me is: don't reload components that contain onClick scripts. 






_______________________________________________
seaside mailing list
seaside at lists.squeakfoundation.org
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/seaside/attachments/20210921/d1abc507/attachment.html>


More information about the seaside mailing list