I’m using the new SC 8.1 ajax buttons on forms but they seem to be very unreliable.
I’ve found two scenarios in which ajax buttons completely stop working: nothing happens when I press them, not even the spinner.
To reproduce, add an ajax button to a form with just this command in it
sc_ajax_message ("Message", "Title", "timeout=0");
Check “Show in the inserting mode”.
Scenario 1 [EDIT - this was not reported correctly - see my next post]
Form with an ajax button is opened in insert mode by a different app where the following code is executed:
sc_apl_conf("form_with_ajax_button",.., "add");
sc_redir("form_with_ajax_button");
Note that the Ajax button work if the form is opened in insertion mode without using sc_apl_conf(); e.g. via sql “where id=-1”.
Scenario 2
Form with an ajax button has one of its field label set to [label_text] and, during OnLoad, [label_text] is set to:
[label_text] = 'Some "double quotes" in a label';
Note that the Ajax button works if [label_text] is set to:
[label_text] = "Some 'single quotes' in a label";
and it works even if ‘Some “double quotes” in a label’ is hardcoded (without the single quotes) in the label setting of the field.
So the problem seems to be with double quotes inside the label but only if the label is set via a [variable].