Trouble using UI Action variables in UI page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 11:45 AM - edited 08-23-2023 11:49 AM
Hi Everyone,
I have a UI Action button that opens a UI Page in a glide dialog window. My UI Action script is as follows:
function openUIPage(){
try{
var floorid = g_form.getValue('floorid');
if (floorid != ''){
var ga = new GlideAjax('Check_Floorplan');
ga.addParam('sysparm_name', 'checkFloorplan');
ga.addParam('floorid', floorid);
ga.getXML(function(response) {
var answer = response.responseXML.documentElement.getAttribute('svg');
if(answer == 'true'){
var gdw = new GlideDialogWindow('x_admis_floorplan_Room_Picker');
gdw.setPreference('sysparm_test', 'abc123');
gdw.setTitle('Room Picker');
gdw.setSize(900, 900);
gdw.render();
}
else{
alert('No floorplan was found for the selected floor');
}
});
}else{
alert('Please select a floor first');
}
}catch(e){
alert(e);
}
}
And in the HTML of my UI Page, I have the following code:
<g:evaluate var="jvar_test">
var sysparm_test = RP.getParameterValue("sysparm_test");
sysparm_test;
</g:evaluate>
Test: ${sysparm_test}
I have also tried this HTML:
<g:evaluate var="jvar_test">
var sysparm_test = RP.getWindowProperties().get("sysparm_test");
sysparm_test;
</g:evaluate>
Test: ${sysparm_test}
However, it seems that no matter what I try, the value of ${sysparm_test} is always null. I have also tried replacing ${sysparm_test} with ${jvar_test}, and the result was the same. How can I access the value of these GlideDialogWindow preferences in my UI Page?
Thanks,
Andrew
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 11:55 AM
Hello @Andrew158 ,
Try this
<g:evaluate var="jvar_test" expression="RP.getParameterValue('sysparm_test')"/>
Hope this helps
Mark my answer correct if this helps you
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 12:18 PM
Hello Mohith,
Thanks for the response. I have tried with the updated HTML:
<g:evaluate var="jvar_test" expression="RP.getParameterValue('sysparm_test')"/>
Test: ${jvar_test}
and unfortunately got the same result of null.