Child pages
  • JSEvent

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR.
Enter additional information related to this 'class' inside the {div} macro with 'id=description'
Divcache
styleindexdisplay:none

...

iddescription

...

padding0px
width80px

...

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Constants Summary
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
ACTION
Constant returned by JSEvent.
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
DATACHANGE
Constant returned by JSEvent.
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
DOUBLECLICK
Constant returned by JSEvent.
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
FOCUSGAINED
Constant returned by JSEvent.
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
FOCUSLOST
Constant returned by JSEvent.
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
FORM
Constant returned by JSEvent.

...

Table Cell (td)
Number

...

true
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClientsWordListMobileClient

servoy sSummary12%30%58%height: 30px;3Constants SummaryConstant 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 JSEvent.

...

Table Cell (td)
Number

...

...

Constant for the CTRL modifier that can be returned by JSEvent.

...

Table Cell (td)
Number

...

...

Constant for the META modifier that can be returned by JSEvent.

...

Table Cell (td)
Number

...

...

Table Cell (td)
String

...

Constant for the SHIFT modifier that can be returned by JSEvent.

...

...

Constant returned by JSEvent.

...

Table Cell (td)
String
Constant returned by JSEvent.

...

...

padding0px
width80px

...

servoy sSummary12%30%58%height: 30px;

...

Table Head (th)
colspan2
Property Summary

...

Table Cell (td)
Object

...

3Property SummaryA data object that specific events can set, a user can set data back to the system for events that supports this.

...

...

padding0px
width80px

...

servoy sSummary12%30%58%height: 30px;

...

Table Head (th)
colspan2
Method Summary

...

Table Cell (td)
String

...

Table Cell (td)
String

...

3Methods Summaryreturns the name of the element, can be null if the form was the source of the event.

...

...

Table Cell (td)
Number

...

returns the name of the form the element was placed on.

...

Returns the modifiers of the event, see JSEvent.

...

Table Cell (td)
Object

...

...

Table Cell (td)
Date

...

Returns the name of the event which was triggeredreturns the source component/element of the event.

...

Returns the time the event occurred.

...

Table Cell (td)
String

...

Table Cell (td)
Number

...

returns the event type see the JSEvents constants what it can return.

...

Table Cell (td)
Number

...

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

...

servoy sDetail

...

padding0px
width100%

...

2100%height:30px

...

colspan1

...

2Constants Details

...

ACTION

...

name

...

ACTION

...

des

...

sIndent
Constant returned by JSEvent.getType() in a method that is attached to an onAction event.

...

ret

...

Returns

...

sIndentclients

...

classsIndent

...

Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
if (event.getType() == JSEvent.ACTION)
{
	// its an action event.
}

...

classlastDetailRow

...

idDATACHANGE
Table Row (tr)
idname
Table Cell (td)
DATACHANGE

...

iddes

...

classsIndent

...

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
DATACHANGEname

DATACHANGE

dessIndent
Constant returned by JSEvent.getType() in a method that is attached to an onDataChange event.

...

ret

...

Returns

...

sIndentclients

...

classsIndent

...

Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
if (event.getType() == JSEvent.DATACHANGE)
{
	// its a data change event
}

...

classlastDetailRow

...

idDOUBLECLICK
Table Row (tr)
idname
Table Cell (td)
DOUBLECLICK

...

iddes

...

classsIndent

...

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
DOUBLECLICKname

DOUBLECLICK

dessIndent
Constant returned by JSEvent.getType() in a method that is attached to an onDoubleClick event.

...

ret

...

Returns

...

sIndentclients

...

classsIndent

...

Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
if (event.getType() == JSEvent.DOUBLECLICK)
{
	// its a double click event.
}

...

classlastDetailRow

...

idFOCUSGAINED
Table Row (tr)
idname
Table Cell (td)
FOCUSGAINED

...

iddes

...

classsIndent

...

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
FOCUSGAINEDname

FOCUSGAINED

dessIndent
Constant returned by JSEvent.getType() in a method that is attached to an onFocusGained or the forms onElementFocusGained event.

...

ret

...

Returns

...

sIndentclients

...

classsIndent

...

Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
if (event.getType() == JSEvent.FOCUSGAINED)
{
	// its a focus gained event.
}

...

classlastDetailRow

...

idFOCUSLOST
Table Row (tr)
idname
Table Cell (td)
FOCUSLOST

...

iddes

...

classsIndent

...

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
FOCUSLOSTname

FOCUSLOST

dessIndent
Constant returned by JSEvent.getType() in a method that is attached to an onFocusLost or the forms onElementFocusLost event.

...

ret

...

Returns

...

sIndentclients

...

classsIndent

...

Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
if (event.getType() == JSEvent.FOCUSLOST)
{
	// its a focus lost event.
}

...

classlastDetailRow

...

idFORM
Table Row (tr)
idname
Table Cell (td)
FORM

...

iddes

...

classsIndent

...

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
FORMname

FORM

dessIndent
Constant returned by JSEvent.getType() in a method that is attached to a form event (like onShow) or command (like onDeleteRecord)

...

ret

...

Returns

...

sIndentclients

...

classsIndent

...

Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
if (event.getType() == JSEvent.FORM)
{
	// its a form event or command
}

...

classlastDetailRow

...

idMODIFIER_ALT
Table Row (tr)
idname
Table Cell (td)
MODIFIER_ALT

...

iddes

...

classsIndent

...

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
MODIFIER_ALTname

MODIFIER_ALT

dessIndent
Constant for the ALT modifier that can be returned by JSEvent.getModifiers();

...

ret

...

Returns

...

sIndentclients

...

classsIndent

...

Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//test if the SHIFT modifier is used.
if (event.getModifiers() & JSEvent.MODIFIER_SHIFT)
{
	//do shift action
}

...

classlastDetailRow

...

idMODIFIER_CTRL
Table Row (tr)
idname
Table Cell (td)
MODIFIER_CTRL

...

iddes

...

classsIndent

...

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
MODIFIER_CTRLname

MODIFIER_CTRL

dessIndent
Constant for the CTRL modifier that can be returned by JSEvent.getModifiers();

...

ret

...

Returns

...

sIndentclients

...

classsIndent

...

Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//test if the SHIFT modifier is used.
if (event.getModifiers() & JSEvent.MODIFIER_SHIFT)
{
	//do shift action
}

...

classlastDetailRow

...

idMODIFIER_META
Table Row (tr)
idname
Table Cell (td)
MODIFIER_META

...

iddes

...

classsIndent

...

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
MODIFIER_METAname

MODIFIER_META

dessIndent
Constant for the META modifier that can be returned by JSEvent.getModifiers();

...

ret

...

Returns

...

sIndentclients

...

classsIndent

...

Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//test if the SHIFT modifier is used.
if (event.getModifiers() & JSEvent.MODIFIER_SHIFT)
{
	//do shift action
}

...

classlastDetailRow

...

idMODIFIER_SHIFT
Table Row (tr)
idname
Table Cell (td)
MODIFIER_SHIFT

...

iddes

...

classsIndent

...

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
MODIFIER_SHIFTname

MODIFIER_SHIFT

dessIndent
Constant for the SHIFT modifier that can be returned by JSEvent.getModifiers();

...

...

ret

...

Returns

...

sIndentclients

...

classsIndent

...

Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//test if the SHIFT modifier is used.
if (event.getModifiers() & JSEvent.MODIFIER_SHIFT)
{
	//do shift action
}

...

classlastDetailRow

...

idNONE
Table Row (tr)
idname
Table Cell (td)
NONE

...

iddes

...

classsIndent

...

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
NONEname

NONE

dessIndent
Constant returned by JSEvent.getType() if the event is not used in a known event or command.

...

ret

...

Returns

...

sIndentclients

...

classsIndent

...

Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
if (event.getType() == JSEvent.NONE)
{
	// type is not set.
}

...

classlastDetailRow

...

idRIGHTCLICK
Table Row (tr)
idname
Table Cell (td)
RIGHTCLICK

...

iddes

...

classsIndent

...

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
RIGHTCLICKname

RIGHTCLICK

dessIndent
Constant returned by JSEvent.getType() in a method that is attached to an onRightClick event.

...

ret

...

Returns

...

sIndentclients

...

classsIndent

...

Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
if (event.getType() == JSEvent.RIGHTCLICK)
{
	// its a right click event.
}

...

classlastDetailRow

...

idproperty
classservoy sDetail

...

padding0px
width100%
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Property Details

...

iddata
Table Row (tr)
idname
Table Cell (td)
data
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
A data object that specific events can set, a user can set data back to the system for events that supports this.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Object
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// 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;

...

classlastDetailRow

...

idfunction
classservoy sDetail

...

padding0px
width100%
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Method Details

...

idgetElementName
Table Row (tr)
idname
Table Cell (td)
getElementName
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getElementName
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
returns the name of the element, can be null if the form was the source of the event.

...

idret

...

classsIndent

...

Table Row (tr)
idname
Table Cell (td)
getFormName
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getFormName
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
returns the name of the form the element was placed on.

...

idret

...

classsIndent

...

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow

propertyservoy sDetail2100%height:30px2Property Detailsdataname

data

dessIndent
A data object that specific events can set, a user can set data back to the system for events that supports this.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow

functionservoy sDetail2100%height:30px2Methods DetailsgetElementNamename

getElementName()

dessIndent
returns the name of the element, can be null if the form was the source of the event.
ret

Returns

sIndent a String representing the element name.
clients

Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
if (event.getElementName() == 'myElement')
{
    elements[event.getElementName()].bgcolor = '#ff0000';
}

...

classlastDetailRow

...

idgetFormName

...

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
getFormNamename

getFormName()

dessIndent
returns the name of the form the element was placed on.
ret

Returns

sIndent a String representing the form name.
clients

...

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

...

classsIndent

...

Sample

...

classsIndent

...

Code Block
languagejavascript
forms[event.getFormName()].myFormMethod();

...

classlastDetailRow

...

idgetModifiers
Table Row (tr)
idname
Table Cell (td)
getModifiers
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
getModifiers
Span
()

...

iddes
sIdentjavascriptlastDetailRowgetModifiersname

getModifiers()

dessIndent
Returns the modifiers of the event, see JSEvent.MODIFIER_XXXX for the modifiers that can be returned.

...

ret

...

Returns

...

sIndent

...

an int which holds the modifiers as a bitset.clients

...

idsam

...

languagejavascript

...

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

...

classsIndent
sIdentjavascriptlastDetailRowgetNamename

getName()

dessIndent
Returns the 

...

name 

...

of 

...

classlastDetailRow

...

idgetSource
Table Row (tr)
idname
Table Cell (td)
getSource
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Object
Span
stylefont-weight: bold;
getSource
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
returns the source component/element of the event.
If it has a name the getElementName() is the name of this component.

...

idret

...

classsIndent

...

the event which was triggered
ret

Returns

sIndent name of event as string
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getSourcename

getSource()

dessIndent
returns the source component/element of the event.
If it has a name the getElementName() is the name of this component.
ret

Returns

sIndent an Object representing the source of this event.
clients

Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// 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();

...

classlastDetailRow

...

idgetTimestamp
Table Row (tr)
idname
Table Cell (td)
getTimestamp
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Date
Span
stylefont-weight: bold;
getTimestamp
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns the time the event occurred.

...

idret

...

classsIndent

...

classlastDetailRow

...

idgetType
Table Row (tr)
idname
Table Cell (td)
getType
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getType
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
returns the event type see the JSEvents constants what it can return.
Plugins can create events with there own types.

...

idret

...

classsIndent

...

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
getTimestampname

getTimestamp()

dessIndent
Returns the time the event occurred.
ret

Returns

sIndent a Date when this event happened.
clients

Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
event.getTimestamp();

...

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
getTypename

getType()

dessIndent
returns the event type see the JSEvents constants what it can return.
Plugins can create events with there own types.
ret

Returns

sIndent a String representing the type of this event.
clients

...

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

...

classlastDetailRow

...

idgetX
Table Row (tr)
idname
Table Cell (td)
getX
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
getX
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
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.

...

idret

...

classsIndent

...

Sample

...

classsIndent

...

Code Block
languagejavascript
if (event.getType() == JSEvent.ACTION)
{
	// its an action event.
}

...

classlastDetailRow

...

idgetY
Table Row (tr)
idname
Table Cell (td)
getY
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
getY
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
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.

...

idret

...

classsIndent

...

sIdentjavascriptlastDetailRowgetXname

getX()

dessIndent
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.
ret

Returns

sIndent an int representing the X position.
clients

Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var x = event.getX();
var xPrevious = previousEvent.getX();
var movedXPixels = x -xPrevious;

...

classlastDetailRow

...

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
getYname

getY()

dessIndent
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.
ret

Returns

sIndent an int representing the Y position.
clients

Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var y = event.getY();
var yPrevious = previousEvent.getY();
var movedYPixels = y -yPrevious;

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow