Constant returned by JSEvent. |
|
Constant returned by JSEvent. |
|
Constant returned by JSEvent. |
|
Constant returned by JSEvent. |
|
Constant returned by JSEvent. |
|
Constant returned by JSEvent. |
|
Constant for the ALT modifier that can be returned by JSDNDEvent. |
|
Constant for the CTRL modifier that can be returned by JSDNDEvent. |
|
Constant for the META modifier that can be returned by JSDNDEvent. |
|
Constant for the SHIFT modifier that can be returned by JSDNDEvent. |
|
Constant returned by JSEvent. |
|
Constant returned by JSDNDEvent. |
|
Constant returned by JSDNDEvent. |
|
Constant returned by JSDNDEvent. |
|
Constant returned by JSDNDEvent. |
|
Constant returned by JSEvent. |
|
|
A data object that specific events can set, a user can set data back to the system for events that supports this. |
|
The event data mime type. |
|
|
Returns the result of the drag action. |
|
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 JSDNDEvent. |
|
Returns the name of the event which was triggered |
|
Returns the record of the event. |
|
returns the source component/element of the event. |
|
Returns the time the event occurred. |
|
returns the dnd event type see the JSDNDEvents 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. |
|
|
Constant returned by JSEvent.getType() in a method that is attached to an onAction event. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample if (event.getType() == JSEvent.ACTION)
{
// its an action event.
} |
|
|
|
|
Constant returned by JSEvent.getType() in a method that is attached to an onDataChange event. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample if (event.getType() == JSEvent.DATACHANGE)
{
// its a data change event
} |
|
|
|
|
Constant returned by JSEvent.getType() in a method that is attached to an onDoubleClick event. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample if (event.getType() == JSEvent.DOUBLECLICK)
{
// its a double click event.
} |
|
|
|
|
Constant returned by JSEvent.getType() in a method that is attached to an onFocusGained or the forms onElementFocusGained event. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample if (event.getType() == JSEvent.FOCUSGAINED)
{
// its a focus gained event.
} |
|
|
|
|
Constant returned by JSEvent.getType() in a method that is attached to an onFocusLost or the forms onElementFocusLost event. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample if (event.getType() == JSEvent.FOCUSLOST)
{
// its a focus lost event.
} |
|
|
|
|
Constant returned by JSEvent.getType() in a method that is attached to a form event (like onShow) or command (like onDeleteRecord) |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample if (event.getType() == JSEvent.FORM)
{
// its a form event or command
} |
|
|
|
|
Constant for the ALT modifier that can be returned by JSDNDEvent.getModifiers(); |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample //test if the SHIFT modifier is used.
if (event.getModifiers() & JSDNDEvent.MODIFIER_SHIFT)
{
//do shift action
} |
|
|
|
|
Constant for the CTRL modifier that can be returned by JSDNDEvent.getModifiers(); |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample //test if the SHIFT modifier is used.
if (event.getModifiers() & JSDNDEvent.MODIFIER_SHIFT)
{
//do shift action
} |
|
|
|
|
Constant for the META modifier that can be returned by JSDNDEvent.getModifiers(); |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample //test if the SHIFT modifier is used.
if (event.getModifiers() & JSDNDEvent.MODIFIER_SHIFT)
{
//do shift action
} |
|
|
|
|
Constant for the SHIFT modifier that can be returned by JSDNDEvent.getModifiers(); |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample //test if the SHIFT modifier is used.
if (event.getModifiers() & JSDNDEvent.MODIFIER_SHIFT)
{
//do shift action
} |
|
|
|
|
Constant returned by JSEvent.getType() if the event is not used in a known event or command. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample if (event.getType() == JSEvent.NONE)
{
// type is not set.
} |
|
|
|
|
Constant returned by JSDNDEvent.getType() in a method that is attached to an onDrag event. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample if (event.getType() == JSDNDEvent.ONDRAG)
{
// its an ondrag event
if (event.getElementName() == 'todragelement')
return DRAGNDROP.COPY
} |
|
|
|
|
Constant returned by JSDNDEvent.getType() in a method that is attached to an onDragEnd event. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample if (event.getType() == JSDNDEvent.ONDRAGEND)
{
// its an on drag end event.
// return true if the drop has been completed successfully
return event.isDropSuccess();
} |
|
|
|
|
Constant returned by JSDNDEvent.getType() in a method that is attached to an onDragOver event. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample if (event.getType() == JSDNDEvent.ONDRAGOVER)
{
// its an on drag over event.
// return true if it over the right element.
return event.getElementName() == 'candroponelement';
} |
|
|
|
|
Constant returned by JSDNDEvent.getType() in a method that is attached to an onDrop event. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample if (event.getType() == JSDNDEvent.ONDROP)
{
// its a on drop event.
var element = elements[event.getElementName()];
// do drop on element
return true;
} |
|
|
|
|
Constant returned by JSEvent.getType() in a method that is attached to an onRightClick event. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample if (event.getType() == JSEvent.RIGHTCLICK)
{
// its a right click event.
} |
|
|
|
|
|
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;
elements[event.getElementName()].setText(data);
return true; |
|
|
|
|
The event data mime type. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample // only accept drag if data is a servoy record
function onDragOver(event)
{
if(event.dataMimeType.indexOf("application/x-servoy-record-object") == 0) return true;
else return false;
} |
|
|
|
|
|
Returns the result of the drag action. |
|
|
Returns Number a DRAGNDROP constant, representing the result of the drag action |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample function onDragEnd(event)
{
var dragResult = event.getDragResult();
if(dragResult == DRAGNDROP.NONE)
{
// the drag was canceled
}
else if(dragResult == DRAGNDROP.COPY)
{
// the drag ended with a copy action
}
else if(dragResult == DRAGNDROP.MOVE)
{
// the drag ended with a move action
}
} |
|
|
|
|
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. |
|
|
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. |
|
|
Returns String a String representing the form name. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample forms[event.getFormName()].myFormMethod(); |
|
|
|
|
Returns the modifiers of the event, see JSDNDEvent.MODIFIER_XXXX for the modifiers that can be returned. |
|
|
Returns Number an int which holds the modifiers as a bitset. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample //test if the SHIFT modifier is used.
if (event.getModifiers() & JSDNDEvent.MODIFIER_SHIFT)
{
//do shift action
} |
|
|
|
|
Returns the name of the event which was triggered |
|
|
Returns String name of event as string |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample var name = event.getName(); |
|
|
|
|
Returns the record of the event. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
|
returns the source component/element of the event.
If it has a name the getElementName() is the name of this component. |
|
|
Returns Object an Object representing the source of this event. |
|
|
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. |
|
|
Returns Date a Date when this event happened. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
|
returns the dnd event type see the JSDNDEvents constants what it can return. |
|
|
Returns String a String representing the type of this event. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample if (event.getType() == JSDNDEvent.ONDROP)
{
// it's a drop
} |
|
|
|
|
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. |
|
|
Returns Number an int representing the X position. |
|
|
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. |
|
|
Returns Number an int representing the Y position. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample var y = event.getY();
var yPrevious = previousEvent.getY();
var movedYPixels = y -yPrevious; |
|
|
|
|
|
|