In the script I am working on,[1] I have a PanelLayout that is defined like this:
this.previewResult = new OO.ui.PanelLayout({ expanded: true, padded: true, framed: true, $content: '' });
Later on, I would like to modify the content of this; specifically, I want to use MW API to retrieve the parsed output of some short wikitext. For now, however, I just want to try out the concept by replacing the content with a simple <p> tag.
Evidently, this line of code does not do the trick:
dialog.previewResult.$content = '<p>Something</p>';
That is, it does update the value of the $content property for the OOUI object, but that does not result in the object getting re-rendered. None of the setter functions for OO.ui.PanelLayout seem to do the trick either.
What is the correct way to do this? If PanelLayout is not the right object type for this purpose, what is?