Variable Editor in an UI Page

ralvarez
Tera Guru

Hi,

I'm trying to use the Variable Editor component in an UI Page. Aparently this component, "com.glideapp.questionset.DefaultQuestionEditor", can be called from an UI Macro using this line


<g2:render_component componentName="com.glideapp.questionset.DefaultQuestionEditor"/>

I only managed to make it work in a Task form as formatter, but not in an UI Page.
Does anybody know how can this be done?
Thank you in advance for your help.

1 ACCEPTED SOLUTION

ralvarez
Tera Guru

It has been hard to find it, but here you have the solution.



<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">

<table width="100%">
<tr>
<j:set var="jvar_ticket_id" value="${sysparm_taskid}" />
<g:evaluate jelly="true">
var incident = new GlideRecord('incident');
incident.get('${jvar_ticket_id}');
</g:evaluate>
<j2:set var="ref" value="incident" />
<j2:set var="jvar_questionset_read_only" value="true" />
<td colspan="2">
<g2:render_component componentName="com.glideapp.questionset.DefaultQuestionEditor" />
</td>
</tr>
</table>

</j:jelly>


View solution in original post

3 REPLIES 3

ralvarez
Tera Guru

It has been hard to find it, but here you have the solution.



<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">

<table width="100%">
<tr>
<j:set var="jvar_ticket_id" value="${sysparm_taskid}" />
<g:evaluate jelly="true">
var incident = new GlideRecord('incident');
incident.get('${jvar_ticket_id}');
</g:evaluate>
<j2:set var="ref" value="incident" />
<j2:set var="jvar_questionset_read_only" value="true" />
<td colspan="2">
<g2:render_component componentName="com.glideapp.questionset.DefaultQuestionEditor" />
</td>
</tr>
</table>

</j:jelly>


Thank you very much for sharing!


You probably just saved me a few hours of work, stress and research!



Much appreciated



Kind Regards,


Michel


Happy to read that my solution helped you Michel.



Kind regards,


Roberto