Accessing an M-Business JavaScript engine event object

In order for your JavaScript event handler function to access the event object, you must explicitly assign the event handler at runtime within your JavaScript code. You can do this using one of the following two methods:

objInput.onclick = myEventHandler(evt) {
    alert(this.name + " you clicked on (X,Y)= ("
    + evt.clientX + ", " + evt.clientY + ")"); return; };

Or

objInput.onclick = myEventHandler;

For both methods, the event object is always passed as the first argument.

M-Business JavaScript engine supports the following event handlers:

  • onClick

  • onKeyDown – except with form controls

  • onKeyPress – except with form controls

  • onKeyUp – except with form controls

  • onMouseDown – except with form controls

  • onMouseMove – except with form controls

  • onMouseOut – except with form controls

  • onMouseUp – except with form controls

    Note

    You need to write a PODSEventHandler and register it with the PODSEventMgr. The PODSEventHandler has a single handleEvent() method that takes a PODSEvent object. A PODSEvent is a simple wrapper on the native event type for each platform.

    See the ObjectSrc sample POD in the pods.zip file, available from [external link] http://www.ianywhere.com/developer/product_manuals/mbusiness_anywhere/, for a similar example of creating a PODSObjectSrc and registering it with the PODSObjectMgr. You can download the pods.zip file from:

    [external link] http://www.ianywhere.com/developer/product_manuals/mbusiness_anywhere