A data object that specific events can set, a user can set data back to the system for events that supports this. |
|
|
returns the name of the element, can be null if the form was the source of the event. |
|
returns the name of the form the element was placed on. |
|
Returns the modifiers of the event, see JSEvent. |
|
returns the source component/element of the event. |
|
Returns the time the event occurred. |
|
returns the event type see the JSEvents constants what it can return. |
|
Returns the x position of the event, relative to the component that fired it, if applicable. |
|
Returns the y position of the event, relative to the component that fired it, if applicable. |
|
|
A data object that specific events can set, a user can set data back to the system for events that supports this. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample // A client design method that handles ondrag
if (event.getType() == JSEvent.ONDRAG)
{
// the data is the selected elements array
var elements = event.data;
// only start a client design drag when there is 1 element
if (elements.length == 1)
{
return true;
}
}
// code for a data drag method
event.data = "drag me!";
return DRAGNDROP.COPY;
// code for a data drop method
var data = event.data;
elemements[event.getElementName()].setText(data);
return true; |
|
|
|
|
|
returns the name of the element, can be null if the form was the source of the event. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample if (event.getElementName() == 'myElement')
{
elements[event.getElementName()].bgcolor = '#ff0000';
} |
|
|
|
|
returns the name of the form the element was placed on. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample forms[event.getFormName()].myFormMethod(); |
|
|
|
|
Returns the modifiers of the event, see JSEvent.MODIFIER_XXXX for the modifiers that can be returned. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample //test if the SHIFT modifier is used.
if (event.getModifiers() & JSEvent.MODIFIER_SHIFT)
{
//do shift action
} |
|
|
|
|
returns the source component/element of the event.
If it has a name the getElementName() is the name of this component. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample // cast to runtime text field (change to anoter kind of type if you know the type)
/** @type {RuntimeTextField} */
var source = event.getSource();
var sourceDataProvider = source.getDataProviderID(); |
|
|
|
|
Returns the time the event occurred. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
|
returns the event type see the JSEvents constants what it can return.
Plugins can create events with there own types. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample if (event.getType() == JSEvent.ACTION)
{
// its an action event.
} |
|
|
|
|
Returns the x position of the event, relative to the component that fired it, if applicable.
For example drag'n'drop events will set the x,y positions. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample var x = event.getX();
var xPrevious = previousEvent.getX();
var movedXPixels = x -xPrevious; |
|
|
|
|
Returns the y position of the event, relative to the component that fired it, if applicable.
For example drag'n'drop events will set the x,y positions. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample var y = event.getY();
var yPrevious = previousEvent.getY();
var movedYPixels = y -yPrevious; |
|
|
|
|
|
|