[Glass] How to ensure onSuccess: is sent

jtuchel at objektfabrik.de jtuchel at objektfabrik.de
Mon May 10 11:48:58 PDT 2021


two questions out of the blue:

  * did you make sure the ajax request is a success in all cases (HTTP 200)?
  * sounds a bit like the submit event of a surrounding form might
    sometimes get in your way. Is that possible? Are you sure it is not
    the case?

Maybe both are completely pointless, just brainstorming


Am 10.05.21 um 20:21 schrieb Bob Nemec via Glass:
> I've posted this question on the PharoJS Seaside forum and on 
> stackoverflow, asking about onSuccess: not working correctly after a 
> callback. In a text input field, if the user presses the [Enter] key 
> we run this code...
> html jQuery ajax
>         callback: [:value | self doSearchWith: value] value: html 
> jQuery this value;
>         onSuccess: ((html jQuery id: 'fieldId') load html: [:h | 
> ...div to be rendered after search... ])
> The intermittent symptom is that the user enters a value, presses 
> [Enter]. The entered value reverts back to the previous value and the 
> search result does not change. At first I thought the problem was that 
> the onSuccess: script was being sent before the callback, but, after 
> reading the gem logs more carefully, the problem turns out to be that 
> the onSuccess: script is not run at all. The only place I run multiple 
> web servers is in our GS + HAProxy setup. There is never a problem 
> with one gem or in VW.
> If I add 'async: false' then the onSuccess: script always runs. But 
> while the callback is running, the user sees no feedback. For most 
> user actions I show a busy gif and a 10% opaque overlay. Neither of 
> those work with 'async: false' because all display rendering held up.
> Any suggestions for how I can ensure a onSuccess: script runs after a 
> callback?
> I understand that onSuccess: depends on the HTTP response code, but 
> the callback action is always successful.
> Thanks for any help,
> Bob Nemec
> _______________________________________________
> Glass mailing list
> Glass at lists.gemtalksystems.com
> https://lists.gemtalksystems.com/mailman/listinfo/glass

Objektfabrik Joachim Tuchel          mailto:jtuchel at objektfabrik.de
Fliederweg 1                         http://www.objektfabrik.de
D-71640 Ludwigsburg                  http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0         Fax: +49 7141 56 10 86 1

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gemtalksystems.com/mailman/private/glass/attachments/20210510/f2c4bfd6/attachment.htm>

More information about the Glass mailing list