When a CQ.form.RichText is added to a custom multifield widget in cq5 , the content of rich text component is disappearing when the dialog is opened again for editing or adding new entry of custom widget. Clicking OK makes the content disapper on cq component's .html page.
Looking for inputs and if any one has come across such issue, could you please direct me to the solution approach.
EDIT :
here is the code sample from custom.js (just posting RichText portion, there is a DateTime and TextField along with richtext in the custom widget)
this.news= new CQ.form.RichText({
cls: "customwidget-4",
fieldLabel: "News",
allowBlank: false,
listeners: {
change: {
scope: this,
fn: this.updateHidden
},
destroy: {
scope: this,
fn: this.descDestroy
}
}
});
this.add(this.news);
and here is the descDestroy snippet:
descDestroy: function() {
this.news.el.dom = {};
}
then registering custom widget as xtype:
CQ.Ext.reg("CustomNews", CQ.form.CustomNews);
Using the above "CustomNews" in dialog.json:
{
"title": "Custom News Widget",
"jcr:primaryType": "cq:Dialog",
"xtype": "dialog",
"items": {
"jcr:primaryType": "cq:WidgetCollection",
"tab1": {
"jcr:primaryType": "cq:Widget",
"title": "News Component",
"xtype": "panel",
"items": {
"jcr:primaryType": "cq:WidgetCollection",
"news": {
"jcr:primaryType": "cq:Widget",
"fieldDescription": "Press + to add more links",
"fieldLabel": "News",
"hideLabel": false,
"name": "./news",
"width": 1000,
"xtype": "multifield",
"fieldConfig": {
"jcr:primaryType": "cq:Widget",
"xtype": "CustomNews"
}
}
}
}
}
}
Thanks in advance.