Pages

Friday, 20 December 2013

Handling richtext in multifield - CQ5

Solution 1:

1) Overlay /libs/cq/ui/widgets/source/widgets/form/RichText.js 
2) In the overlaid file, at Line 910;  replace (a) by (b)
(a) this.el.dom.value = html;
(b) if(this.el.dom){this.el.dom.value = html;} 


Solution 2:

You need to set richtext's destroy event handler, to create dummy this.el.dom as shown below:

<myField
    jcr:primaryType="cq:Widget"
    name="./myField"
    xtype="multifield">
    <fieldConfig
        jcr:primaryType="cq:Widget"
        xtype="richtext">
        <listeners
            jcr:primaryType="nt:unstructured"
            destroy="function() {this.el.dom={};}"/>
    </fieldConfig>
</myField>


No comments:

Post a Comment

Converting InputStream to String

    private String convertToString(InputStream inputStreamObj)             throws IOException {         if (inputStreamObj != null) {     ...