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

Karsten Kusche karsten at heeg.de
Tue Sep 14 12:58:25 UTC 2021


Hi Bob,

We use onBlur to get the data from input fields and to refresh the state of the view. The problem comes up if a button is included in the refresh: the ajax callback from that button is not handled (which makes sense due to the jQuery load), so the user has to press the button again.

I’d say it actually doesn’t make any sense. Your callbacks are registered, they should work regardless. You could use the Web-Browser’s network tool/profiler to see which event-handler is fired and what network requests are made. Maybe one of the requests doesn’t come through correctly and you can investigate that further.

Some things you should also consider: when you use render HTML-Snippets that contain Javascript (like new click-handlers), Seaside will automatically add these inside a <script>-tag at the end of this snippet and inject that into your DOM at the place where you inject the HTML. In your case you should have a <script>-tag at the end of your #testDiv.

I’m not entirely sure about this, but iirc replacing that script-tag will also remove all event-handlers that were registered as part of this tag. On the other hand replacing the <script> also means replacing the <button> so you should still have a working button in any case… like i said, it doesn’t really make much sense.

Karsten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/seaside/attachments/20210914/71359e4f/attachment.html>


More information about the seaside mailing list