gx_event.cancel() of pageOnKeyDown doesn't work

Hi,

We have a problem with gx_event.cancel() function of ApplinX (version 5.5.2.0038) when we try to stop or prevent the page refresh by pressing a function key, in particular the ENTR key.

We have a jsp page with jQuery into an ApplinX application and when pressing ENTR we want to run a webservice with jQuery without releasing the function key against the Host and without refreshing the jsp.

The problem is the gx_event.cancel () function doesn’t seem to work. We want to press ENTR and invoke the WebService and modify the information returned in the page with the result of webservice without refreshing the page.

Despite the function gx_event.cancel () is called, the page is submited, and we lose all the information we had changed in the page. We do not know how to prevent the submit event in the page.

Can someone tell us how to do when we press ENTR key run some javascript function without refreshing the jsp? Why gx_event.cancel() does not prevent the page refresh? Could this be a bug in ApplinX?

Reference:
http://techcommunity.softwareag.com/ecosystem/documentation/webmethods/wmsuites/wmsuite8-2_sp2/ApplinX/8-2-SP2_ApplinX/advdev/GenAppCus.htm#controljsgxevent

function pageOnKeyDown(gx_event){
if (gx_event.keyCode==GXKeyCodes.ENTER){ // = 13
invokeWebServiceJQuery();
gx_event.cancel();
}
}

Any idea is welcome.

Thanks in advance

Hi Pedro,

I’ve checked this in my machine and it worked.

I assume that it can be:

  1. A bug in your version (I used 8.2.2)
  2. A javascript error in invokeWebServiceJQuery function which causes the javascript engine to stop working. Please try to remark this function and than try again. If this still occurs I suggest upgrading to a newer version.

Best Regards,
Assaf