- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2022 02:58 PM
How to pass a parameter to a tinymce in a UI page?
I am passing the following info through a UI action as follow:
function openUIPage() {
var dialog = new GlideDialogWindow('x_banun_creops_ui_page_demo');
dialog.setTitle("TITLE")); //Set the dialog title
dialog.setPreference('sysparm_emailbody', g_form.getValue('email_body') );
dialog.render(); //Open the dialog
}
How do I pass that into a UI page that has the following TinyMCE?
<g:evaluate var="jvar_email_body" expression="RP.getWindowProperties().get('sysparm_emailbody')" />
<script>
tinymce.init({
mode : "specific_textareas",
editor_selector : "mce",
width: '100%',
height: '300px',
menubar: "tools",
toolbar: "$[gs.getProperty('glide.ui.html.editor.v4.toolbar.line1')]",
content_css : "* {font: 10px arial, sans-serif;} b {font-weight:bold;} th {font-weight:bold;} strong {font-weight:bold;}",
});
</script>
<textarea cols="80" rows="10" id="myArea2" name="myArea" class="mce"></textarea>
I tried to do value="${sysparm_emailbody}" but I had no luck!
SO I want to see the value that I passed inside the tinymce field.
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2022 03:30 PM
<textarea cols="80" rows="10" id="myArea2" name="myArea" class="mce">
${jvar_v1}
</textarea>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2022 03:33 PM
No worries you can follow below format to print it in HTML .use your jvar variable between text area tags
<textarea cols="80" rows="10" id="myArea2" name="myArea" class="mce">
${jvar_v1}
</textarea>
or
Add a value attribute like below and assign your jvar variable
<textarea cols="80" rows="10" id="myArea2" value="${jvar_v1}" name="myArea" class="mce"></textarea>
Please try both and let me know if it works