May 05, 2024 16:42 Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients SampleSupported Clients
SmartClient
WebClient
NGClient
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.
Methods 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, relative to the component that fired it, if applicable.
Number
getY()
Returns the y position of the event, relative to the component that fired it, if applicable.
Property Details
data
A data object that specific events can set, a user can set data back to the system for events that supports this.
// 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;
Methods Details
getElementName()
returns the name of the element, can be null if the form was the source of the event.
if (event.getElementName() == 'myElement')
{
elements[event.getElementName()].bgcolor = '#ff0000';
}
getFormName()
returns the name of the form the element was placed on.
forms[event.getFormName()].myFormMethod();
getModifiers()
Returns the modifiers of the event, see JSEvent.MODIFIER_XXXX for the modifiers that can be returned.
//test if the SHIFT modifier is used.
if (event.getModifiers() & JSEvent.MODIFIER_SHIFT)
{
//do shift action
}
getSource()
returns the source component/element of the event.
If it has a name the getElementName() is the name of this component.
// 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();
getTimestamp()
Returns the time the event occurred.
event.getTimestamp();
getType()
returns the event type see the JSEvents constants what it can return.
Plugins can create events with there own types.
if (event.getType() == JSEvent.ACTION)
{
// its an action event.
}
getX()
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.
var x = event.getX();
var xPrevious = previousEvent.getX();
var movedXPixels = x -xPrevious;
getY()
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.
var y = event.getY();
var yPrevious = previousEvent.getY();
var movedYPixels = y -yPrevious;