AEM Touch UI RTE multifield default table not appearing

41 Views Asked by At

I have a multifield which has table. This table is enabled throught RTE

<table
   jcr:primaryType="nt:unstructured"
   sling:resourceType="cq/gui/components/authoring/dialog/richtext"
   useFixedInlineToolbar="true"
   fieldDescription="Enter two data in a row"
   fieldLabel="Enter the Data"                                                  
   name="./table">

This is inside a multifield

sling:resourceType="granite/ui/components/coral/foundation/form/multifield"

The thing is when I click add, the RTE text area should have a 3x2 table ready as it was previously(specifically, rows=2, columns=3, width=100%)

When I put the below :

value="<table cellpadding='1' cellspacing='1' border='1' width='100%'> <tbody> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> </tbody> </table>"

and build my project, the node doesn't have the value attribute. If I put

value="Some default text"

And build it, then value attribute will be present in the table node in the component and the RTE text area will have "Some default text"

BUT

If I directly edit that value in the node as the "...", then the default 3x2 table will come. But it won't come in build when I put it in the XML but the "Some Default Text" will come in the build in the XML

I tried cq:template but I don't know how many tables will be added, so I can't create item0, item1 nodes early.

I have also tried @Default in the Sling model field of table with

@Inject
    @Default(values="<table cellpadding='1' cellspacing='1' border='1' width='100%'> <tbody> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> </tbody> </table>")
    private String table;

What should I do ? Thanks in advance.

table node in the CRXDE

0

There are 0 best solutions below