How to pass a parameter to a html field in a UI page? (semi easy points)

juan casas
Mega Expert

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.

1 ACCEPTED SOLUTION

@juan casas  use this between <textarea> tags like below and try

 

<textarea cols="80" rows="10" id="myArea2" name="myArea"  class="mce">

${jvar_v1}

</textarea>

View solution in original post

5 REPLIES 5

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