XPage Javascript Alert- Simple Way


XPAGE alert message box :

XPage runs on server side JavaScript, but for simple debugging , or if we need some custom message box on browser we need JavaScript alert that we do normally , but considering server side JavaScript you can not directly add Client side java script alert , but this can be done in simple way using postScript , add below script in any server side script to get message box on your XPage.


XPage alert -

al="alert('Hello , XPage  CS Java Script alert')"
view.postScript(al)

XPAGE alert with some variable value inside it

var userName= "Welcome"+ @username;
al="alert('"+ userName +"')"
view.postScript(al)

That's It !

Thanks .

No comments :

Post a Comment

Leave A Comment...