How to receive parameters from g_modal.showFrame in Ui Page script

MarinaL
Tera Contributor

Hello everyone!
I call UI page from UI action in the csm workspace:

UI Action workspace client script:

function onClick(g_form) {
    var ui_page_id = 'sys_id';
	var url = '/ui_page.do?sys_id=' + ui_page_id + '&sysparm_case_id=' + g_form.getUniqueValue();
	alert(url);
    g_modal.showFrame({
        url: url,
        title: 'name',
        size: 'xl',
        height: 500
    });
}


I added sysparm_case_id parameter with currect case sys_id  to the url to get it in the UI Page
I tried to get it this way, but it doesn't work  

<j:set var = "jvar_case_id" value = "${sysparm_case_id}" />

 but if i'm trying to get "${sys_id}" i will receive the ui page sys_id

Thanks in advance!  

7 REPLIES 7

aasch
Kilo Sage

Hey,

you should be able to retrieve URL parameters inside a UI Page with RP.getParameterValue("<url_parameter_name>").

RP stands for "RenderProperties", which is finally documented in the API reference since a while ago.

Wei_ Ling
Tera Guru

Have you found a solution? I have the same problem!!😊

Angelo Paulo Ad
Tera Contributor

Same issue here.

LuizValmirT
Tera Contributor

Here in my case I had to receive a confirmation response or not from this user creation table, I did it like this and it worked:

function onClick(g_form) {
    g_modal.showFrame({
        url: '/user_registration_request.do',
        title: 'Criação de usuário',
        size: 'lg',
        height: 500,
        autoCloseOn: 'URL_CHANGED',
			callback: function (ret, data) {
				if (ret){
                    var msg = getMessage("Usuário cadastrado com sucesso :)");
                    g_modal.confirm(getMessage("Tudo Certo"), msg);
                } else {
                    var msg = getMessage("Usuário não cadastrado, verifique se o email já está associado a outro usuário.");
                   g_modal.confirm(getMessage("Erro"), msg);
                }
					
			}
    })

}