Search code examples
javascripteventsexecutegenexus

Executing Genexus's Events from JavaScript code


I'm trying to execute a Genexus Event from JavaScript code but It doesn't work. Any idea or suggest?? I'm actually working with Genexus 9 + Java + Web

This is de JS code Im trying for calling Genexus Event:

 function validar(e)
    {
    tecla = (document.all) ? event.keyCode : e.which; 
        if (tecla==13)
            GX_setevent('PRUEBA');          
            gxSubmit(); 
    }

Thanks a lot for your help!! Have a nice day!! :)


Solution

  • I think you are missing the event name. This should work:

    function validar(e)
    {
        tecla = (document.all) ? event.keyCode : e.which;
        if (tecla == 13)
        {
            GX_setevent('E\'PRUEBA\'.');
            gxSubmit();
        }
    
    }