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

Bob Nemec bobn at rogers.com
Tue Sep 21 15:21:31 UTC 2021


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. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/seaside/attachments/20210921/03f65e23/attachment.html>


More information about the seaside mailing list