<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:scriptBlock id="scriptBlockExecuteOnServer">
<xp:this.value><![CDATA[
function executeOnServer() {
if (!arguments[0])
return false;
var functionName = arguments[0];
var refreshId = (arguments[1]) ? arguments[1] : "@none";
var form = (arguments[1]) ? XSP.findForm(arguments[1]) : dojo.query('form')[0];
var options = (arguments[2]) ? arguments[2] : {};
var submitValue = (arguments[3]) ? arguments[3] : '';
dojo.query('[name="$$xspsubmitid"]')[0].value = functionName;
dojo.query('[name="$$xspsubmitvalue"]')[0].value = submitValue;
XSP._partialRefresh("post", form, refreshId, options);
}]]></xp:this.value>
</xp:scriptBlock>
<xp:button value="Exec On Server" id="execOnServer">
<xp:eventHandler event="onclick" submit="false">
<xp:this.script><![CDATA[executeOnServer( "#{id:onMyEvent}" );]]></xp:this.script>
</xp:eventHandler>
</xp:button>
<xp:eventHandler id="onMyEvent" event="onMyEvent" submit="true"
disableValidators="true" refreshMode="norefresh"
action="#{javascript:print('Hello World!')}">
</xp:eventHandler>
</xp:view>