Now I am trying to add a preview function in the dialog box of my plugin. The idea is when I changed the value of a select element, the html element below it will show the specific contents corresponding the selected value.
I've tried to manipulate the html element object in the onchange function of select element, something like this:
var dialogObj = this.getDialog();
var previewEle = dialogObj.getContentElement('main','preview');
previewEle.setValue('<p>'+this.getValue() + '</p>');
Even though I can tell the html element value has been changed by adding a alert function to display the value, the displayed text in the dialog box is still unchanged.
So is there a way to solve this problem?
I figured this out by myself.
I figured this out by myself. I used jQuery to modify the rendered html. Define a div with id or class attribute in the html element.
In select element onchange method use:
$("#divid").html(TextYouWanttoUpdate);