How to receive parameters from g_modal.showFrame in Ui Page script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2024 05:05 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2024 06:51 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2024 01:04 AM
Have you found a solution? I have the same problem!!😊
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2024 06:44 AM
Same issue here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-30-2024 12:07 PM
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);
}
}
})
}