Expand my Community achievements bar.

SOLVED

AEM6.3 updating a node deleting child nodes

Avatar

Level 2

Hi there,

We have an accordion component which was working fine in AEM6.2 and stopped working after the upgrade to AEM 6.3.1.1

Scenario: User comes to the page

                    1. Drag and drop accordion component and opens a dialog that has a multifield where he can just add titles, for example if he add title 1 and title 2 two nodes will be generated as highlighted in orange below.

                              a) we have modified mutifield to point to granite/ui/components/coral/foundation/form/multifield

                              b) composite = true at multifield node

                              c) acs-commons-nested = NODE_STORE at fieldset node

                    2. On authoring screen now he sees two titles along with two parsys component where user can drag and drop the Rich Text editor.

                    3. Author drops RichText component and nodes highlighted in blue are generated.

                    4. Author again opens the accordion dialog to update title at highlighted in orange at node 1 or 2 and closes the dialog after updating.

                              *** All the nodes underneath 1 and 2 gets deleted after updating the title not sure what is wrong. This code was working perfectly fine in AEM6.2

So it creates a node hierarchy: node highlighted in orange has a title property

page

     |--------bodypar

                    |--------accordion

                                        |-----------accList

                                                            |----------1 - Title1

                                                                      |--------par

                                                                                     |---------component (rich text)

                                                            |----------2 - Title2

                                                                      --------par

                                                                                     |---------component (rich text)

Sightly code: - Code highlighted in red includes parsys so that an author can drag and drop a component.

<sly data-sly-use.accordion=".....AccordionModel"></sly>

<div data-sly-test="${wcmmode.edit && !accordion.itemContentList}" data-emptytext="Accordion content authoring area">Accordion content authoring area</div>

<div data-sly-test="${wcmmode.edit}" data-emptytext="Accordion content authoring area">

     <sly data-sly-test="${!isSingleEntry}">

     <ol data-sly-list="${accordion.itemContentList}">

          <li style="clear:both;">

          <p>Title: ${item.accTitle}</p>

         <sly data-sly-test.resourcePath="${ '{0}/{1}/{2}' @ format=[accordion.accList,itemList.count, accordion.par]}">

               <div data-sly-resource="${resourcePath @resourceType='wcm/foundation/components/parsys'}"></div>

          </sly>

          </li>

     </ol>

</div>

Can someone please help?

1 Accepted Solution

Avatar

Correct answer by
Level 2

Found answer to my question after digging into multifield jsp.

Answer: deleteHint (Boolean) = false   | property added at the multifield level which resolved this issue.

Use link for explanation

Apache Sling :: Manipulating Content - The SlingPostServlet (servlets.post)

View solution in original post

5 Replies

Avatar

Correct answer by
Level 2

Found answer to my question after digging into multifield jsp.

Answer: deleteHint (Boolean) = false   | property added at the multifield level which resolved this issue.

Use link for explanation

Apache Sling :: Manipulating Content - The SlingPostServlet (servlets.post)

Avatar

Level 2

Can you please share accordion component? (Sightly + backend)

Avatar

Level 2

Hi Razvi,

I am trying to do somewhat similar in AEM 6.4. But I noticed that once I add deleteHint (Boolean) = false, I am not able to delete any multifield entry from dialog. In your example, are you able to delete Title1 or Title2 from dialog once you add deleteHint = false ?

Could you also please share your thoughts?

Thank you for your time.

Best Regards,

Ananta

Avatar

Level 1
Hi, have you found any solution for that? I have the same issue

Avatar

Level 1

@ananta99 Hi, please let me know if you have found solution for this, I have now the same issue