gs.getmessage in UI script?

deepakvednegi
Giga Contributor

I am calling a UI page from a Ui script on the basis of following code.

 

 var Dialog = new GlideDialogWindow('MyDialog');
     Dialog.setSize(580,550);
     Dialog.setTitle('${gs.getMessage("Test title")}');
     Dialog.render();

 

But the dialog is opening without any text. Do anyone knows how to implement this because I want to use the localised values for title also.

 

Thanks

Deepak

1 ACCEPTED SOLUTION

deepakvednegi
Giga Contributor

Hi guys
Sorry to ask a silly question. I forgot that we can call getMessage('String') in client script while it is gs.getMessage('String') in server side. It is working fine now



Thanks


Deepak


View solution in original post

7 REPLIES 7

Chandan23
Tera Expert

gs.getMessage() is server side script. please remove this.


harikrish_v
Mega Guru

try something like this:-



<g2:evaluate>  


  var mess = gs.getMessage("Test title");


</g2:evaluate>



then $[mess]



should work..


I am calling the dialog from UI script but I want to set the title as localized label depending upon user language.
How I can attain this.



Is there any way I can set the dialog title in UI page itself


Oh sorry, I didnt read your question fully and yes you can call and set the dialog title in the UI page itself. call a function based on an event on your UI page(can be onload, onlick, onsubmit etc), goto client script part in the UI page, define this function and make the dialog call.