0

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!! :)

Carol
  • 553
  • 2
  • 10
  • 24

2 Answers2

2

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();
    }

}
Gonzalo Gallotti
  • 2,413
  • 3
  • 23
  • 28
0

I'm using this syntax.

Event EventName [KEY]
EndEvent

where KEY is de Function key assigned to the event.

For example

 Event 'PRUEBA' 13
   //YOUR CODE
 EndEvent

When you press F13, event PRUEBA is fired.

Only works for Function KEYs and not for Enter

ealmeida
  • 444
  • 3
  • 11