\\
| Constants Summary | |
|---|---|
| String | ACTION Constant returned by JSEvent. |
| String | DATACHANGE Constant returned by JSEvent. |
| String | DOUBLECLICK Constant returned by JSEvent. |
| String | FOCUSGAINED Constant returned by JSEvent. |
| String | FOCUSLOST Constant returned by JSEvent. |
| String | FORM Constant returned by JSEvent. |
| Number | MODIFIER_ALT Constant for the ALT modifier that can be returned by JSEvent. |
| Number | MODIFIER_CTRL Constant for the CTRL modifier that can be returned by JSEvent. |
| Number | MODIFIER_META Constant for the META modifier that can be returned by JSEvent. |
| Number | MODIFIER_SHIFT Constant for the SHIFT modifier that can be returned by JSEvent. |
| String | NONE Constant returned by JSEvent. |
| String | ONDRAG Constant returned by JSEvent. |
| String | ONDRAGOVER Constant returned by JSEvent. |
| String | ONDROP Constant returned by JSEvent. |
| String | RIGHTCLICK Constant returned by JSEvent. |
| Property Summary | |
|---|---|
| Object | data A data object that specific events can set, a user can set data back to the system for events that supports this. |
| Method Summary | |
|---|---|
| String | getElementName() returns the name of the element, can be null if the form was the source of the event. |
| String | getFormName() returns the name of the form the element was placed on. |
| Number | getModifiers() Returns the modifiers of the event, see JSEvent. |
| Object | getSource() returns the source component/element of the event. |
| Date | getTimestamp() Returns the time the event occurred. |
| String | getType() returns the event type see the JSEvents constants what it can return. |
| Number | getX() Returns the x position of the event if applicable. |
| Number | getY() Returns the x position of the event if applicable. |
| Method Details |
|---|
getElementName |
| StringgetElementName() |
returns the name of the element, can be null if the form was the source of the event. |
| Returns String – a String representing the element name. |
Sampleif (event.getElementName() == 'myElement')
{
elements[event.getElementName()].bgcolor = '#ff0000';
}
|
getFormName |
| StringgetFormName() |
returns the name of the form the element was placed on. |
| Returns String – a String representing the form name. |
Sampleforms[event.getFormName()].myFormMethod(); |
getModifiers |
| NumbergetModifiers() |
Returns the modifiers of the event, see JSEvent.MODIFIER_XXXX for the modifiers that can be returned. |
| Returns Number – an int which holds the modifiers as a bitset. |
Sample//test if the SHIFT modifier is used. if (event.getModifiers() & JSEvent.MODIFIER_SHIFT) { //do shift action } |
getSource |
| ObjectgetSource() |
returns the source component/element of the event. |
| Returns Object – an Object representing the source of this event. |
Samplevar sourceDataProvider = event.getSource().getDataProviderID();
|
getTimestamp |
| DategetTimestamp() |
Returns the time the event occurred. |
| Returns Date – a Date when this event happened. |
Sampleevent.getTimestamp(); |
getType |
| StringgetType() |
returns the event type see the JSEvents constants what it can return. |
| Returns String – a String representing the type of this event. |
Sampleif (event.getType() == JSEvent.ACTION) { // its an action event. } |
getX |
| NumbergetX() |
Returns the x position of the event if applicable. |
| Returns Number – an int representing the X position. |
Samplevar x = event.getX(); var xPrevious = previousEvent.getX(); var movedXPixels = x -xPrevious; |
getY |
| NumbergetY() |
Returns the x position of the event if applicable. |
| Returns Number – an int representing the Y position. |
Samplevar y = event.getY(); var yPrevious = previousEvent.getY(); var movedYPixels = y -yPrevious; |