eventHandler - Event Handler (control)

Responds to user actions such as clicking a control.


Other Controls


<xp:eventHandler attributes>content</xp:eventHandler>
Table 1. Essential properties
Property Description
save Saves form-associated data or not. This should be false for buttons of type Cancel.
submit This is true to send a request to and get a response from the server. A client handler can cancel sending a request by returning false.
refreshMode Specifies whether the page refresh is complete, partial, or not performed.
immediate This should be true for buttons of type Cancel.
Table 2. All properties
Category Properties
basics binding, disableValidators, event, execId, execMode, handlers, id, loaded, navigate, refreshId, refreshMode, rendered, rendererType, save, submit, value
data parameters
events action, actionListener, actionListeners, immediate, onComplete, onError, onStart, script
styling disableTheme, themeId


See Understanding events.


This is a Button control of type Submit.
<xp:button value="submit" id="button1">
	<xp:eventHandler event="onclick" submit="true"
		refreshMode="complete" immediate="false" save="true">
This is a Button control of type Cancel.
<xp:button value="cancel" id="button2">
	<xp:eventHandler event="onclick" submit="true"
		refreshMode="complete" immediate="true" save="false">
This is a Button control with a user-coded onclick event.
<xp:button value="set username" id="button3">
	<xp:eventHandler event="onclick" submit="true" refreshMode="complete">