Hi Leute,
auch wenn der thread schon etwas älter ist schreibe ich den verweis mal dazu. habe länger nach der Lösung gesucht und die ist einfach unf Genial: http://xpagesblog.com/xpages-blog/2010/4/30/calling-client-side-javascript-from-server-side-javascript.html
Ich habe in meine xPage ganz oben den Block eingefügt:
<xp:scriptBlock id="scriptBlock1">
<xp:this.value><![CDATA[
var pleaseAlert = function() {
var flag = "#{javascript:requestScope.pleaseAlert}";
if( flag == "1" ) {
alert("The new bookmark has been created");
window.close();
}
};
XSP.addOnLoad(pleaseAlert);
]]></xp:this.value>
</xp:scriptBlock>
Im Serverside JS steht dann am ende nur ein:
//A function is added in the script block to the XSP.onLaod event
//This function checks for the Variable. If it is "1" the user will
// be informed of the save and the window will close
requestScope.pleaseAlert = "1";
Gruß
HaPe