AJAX onChange event doesn't trigger in Form fields of Select Type or Text-Autocomplet

I am working in SC 7.00.0018
I have a single form application with some text fields (one of them AJAX auto-complete based on a SQL statement) and other select type fields (combo-box).
I have added one “AJAX onChange event” for each one of them, but it seems they don’t execute the code in the events handlers when the fields change their values.

Is it a bug ?

Regards,

Felipe

I think it has to do that you can only assign one ajax event on a field. Try to change the ajax auto-complete to a caption link or set the event on the onfocus of the next field so it will trigger when the user tabs to the new field.

Hello Felipe,

JUst to make sure we are on the same page. Have you added an Ajax onChange event on a Ajax auto-complete field?

regards,
Bernhard Bernsmann

AFAIK yes, and that issue has been reported ages ago. Similar issue if you have an ajax onchange event and a lookup and a trigger to refresh the next select type field. Then the onchange is not fired too. It appears you can have only one ajax event on a field.

Repliying bartho: the answer is yes.

Moreover, and confirming what aducom says: it seems it is not possible to trigger an ajax onChange, onClick, onFocus event attached to any form field type of select or autocomplete. I think it happens with any “complex” field in the sense it has to do certain process like select one of several values.

I have tried to attach javascript events of the same type with the same results.

It seems a big bug.

Regards

Felipe

Hello Felipe,

I have reported this issue to our bugs team for further testing.

regards,
Bernhard Bernsmann

I had that problem, note that removing onchange event in my case, and generating the code again without the event, plus we change the TYPE-FIELDS, generate the code, went back to create onChange events and there if I grabbed
My observation is that as if the code generator does not grind them well above and stay old code

I have a FORM.CLIENTES with a Select object on the table SUPERVISORS, selecting the SUPERVISOR to fill the field and CLIENTES.SUPERVISORES. also in the same process SUPERVISOR I have to get the hierarchy to which it belongs, and assign it to the customers tab CLIENTES.JERARQUIA_SUPERVISOR = SUPERVISOR.JERARQUIA.

My problem is you have to update Onchange RANK-SUPERVISOR field, but can not get on-screen tab CLINETES vueva I attempt to show the new value obtained for the field-SUPERVISOR RANK …

  • How I can refresh the value of this field in the FORM?

I pass the code

/**

  • CLIENTES.SUPERVISOR->ONCHANGE: Busco para el supervisor asignado la jerarquia que tiene y se lo asigno a campo clientes.jerarquia_supervisor = supervisores.jerarquia

*/

$ger_super=“1”;

$check_sql_supervisor = “SELECT idCodigo_supervisor, Jerarquia, "
. " FROM Jerarquia_supervisores”
. " WHERE IdCodigo_supervisor = ‘" .{supervisor}. "’";
sc_lookup(rs, $check_sql_supervisor);

if (isset({rs[0][0]})) // Row found
{
$ger_super={rs[0][1]};
{jerarquia_supervisor} = {rs[0][1]};

}
else // No row found
{
{jerarquia_supervisor} = ‘42’;
sc_field_display({jerarquia_supervisores}, off);

}

echo " Hemos buscado al {supervisor} \p
y hemos obtenido la siguiente jerarquia {jerarquia_supervisor} \p
El resultado de la tabla es $rs posicion 0,1 {rs[0][1]} \p
la sentencia fue $check_sql_supervisor \p
$ger_super" ;

I have done what carlos2325 describes in his 1st pharagraph and could run onClick event of a radio-button field again. It seems something strangeous occurs with the generated code when the type field is changed … the old code could not being deleted well.

Regarding the main reported problem I have discovered the following:

  1. If I change the “autocomplete” field type to simple “text” type, the next field of “select” type can run again onClick, onChange, onFocus code events.
    So, it seems the problem in the select type field was due a bug in the AJAX event handling of the previous autocomplete field.
  2. I have done some tests. I have created a text field in my form to show a value set in each of the AJAX events (for example: “in the onClick of xxxx field”).
    Based in these tests I discovered that:
    2.a) Select type field works fine executing code for the AJAX events onClick, onFocus, onChange. All three events are attached to the field and each one runs at the appropiate conditions.
    2.b) radio-button select type field only executes code for the onClick event, BUT onFocus, onChange doesn’t work.
    2.c) something Albert Drent (aducom) have reported many monthes ago: a menu-link select type field doesn’t run code for onClick or onFocus AJAX events

I have tried only these few type fields, because these are what I need now, but I think someone in SC should test all events type in all other field types.

I hope this report can help the bugs team of SC.

Best Regards,

Felipe Tuteleers

Screen is not updated in the second value field in the FORM, when I run onchange even

MY English is not very good and I express posiblemte well … happened to me and I could solve …

What pedonar not get and ask for help around here, in my paguina get a forum and not let me create new pregutas …

My problem is that even I update a field not resfreca me on screen, that is launched the search, but ONCHANGE therefore selected the supervisor must be updated with the value-supervisor hierarchy as describe this example of code but I can not update …

Not if I have to call some method to update or just a bug …

The code I checked and if it catches you value but is not showing modification cmapo ma-supervisro hierarchy

I’m having the same problem and I see there are several queries in the forum, so I conclude that it is wrong to be solved URGENT.
In my case I have stopped by this development as it is needed if or if using AJAX Onchange Event to calculate a value, it is very frustrating to have to for developing this.

I don’t know but I may figured out ajax event firing issue.

I’ve developed a form application without data dictionary initially. After creating a data dictionary my Ajax events were not firing.

But suddenly I figured that the ajax events are firing after synchronizing the apps with data dictionary.

Dev Team,
Any update for this issue? I’m experiencing the problem with text auto-complete fields, randomly

Regards,

Manuel

Hello Manuel,

I will ask for an update to our bugs team.

regards,
Bernhard Bernsmann

Hello Bartho, did you asked your bugs team about this issue? by the way this post published in 2013

Yes, and afaik he’s not working at SC any more.

Hi!

We have made several changes and solved a lot of problems in our new release (9.3.005).

We from the bug tracker team, reported an error related to field text auto-complete.

The ajax event does not work when this field is selected, but we are solving that and we will release soon.

Nueva versión 9.3.17 no funciona el evento Ajax cuando se activa por medio de un campo autocompletar

resolví creando un evento Ajax y asignando al campo su mismo valor {cliente} = {cliente} ;

y logre que funcione la carga de una select basada en el campo autompletar cliente

Saludos