Expand my Community achievements bar.

Delete or ordrer an item in children editor is not working

Avatar

Level 1

Hi AEM community !

I am trying to make the delete or reorder items in a container component.
So I have a Slider component that depends on the Carousel Container component
In order to manipulate the components displayed in the slider, in the atuhoring dialog, I have a children editor.
I can add items correctly, but I can't delete or reorder items (for example, here, I have a slider component with 3 header components, I delete the 3rd one and invert the order of the 2 remaining)
I can see the POST requests fired (and it seems correct to me):
1st request :
- url : 

     http://localhost:4502/content/twilio-com/global/language-masters/en/blog/_jcr_content/root/global-main/section/column_control_12175/column-0/slider

2nd request :

- url :

http://localhost:4502/content/twilio-com/global/language-masters/en/blog/jcr:content/root/global-main/section/column_control_12175/column-0/slider.container.html
- data: delete=item_1742307087421&order=item_1742250868548&order=item_1742250863830

Those requests are fired when I clicked on "Done" in my slider authoring dialog, so logically, then it is followed by a GET request to get the items and being able to display the new slider component in the page, but in this GET request, I cannot see the changes I've made

I can't find the backend that handles thoses POST requests, I just don't understand how they should be handled

Can someone help me on this issue ?
4 Replies

Avatar

Community Advisor

Hi @StephanePo1 

Content Manipulating using post request is supported OOTB and handled by Sling Post Servlet

https://sling.apache.org/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-po... 



Arun Patidar

Avatar

Community Advisor

Hi @StephanePo1 ,

Common Reasons Why Delete/Reorder Fail:

1. Filtered Resource Path — Wrong POST URL

Ensure that your POST URL correctly maps to the real JCR node without resource types involved.
You posted to:

/content/.../slider

Make sure this node exists physically in CRXDE. If it’s a proxy or sling:resourceType, POST will not work as expected.

2. Node Structure — Children Not Stored Correctly

In your component’s JCR structure, items should be stored under the same node where the POST is sent.
E.g:

/slider
  /item_1
  /item_2

If they are not under /slider, or managed by a different resource, POST won’t delete or reorder them.

3. Dialog Misconfiguration — childrenEditor Bound Incorrectly

Your dialog must correctly bind to the children resource.
Key config for children editor:

<items jcr:primaryType="nt:unstructured"
       sling:resourceType="cq/gui/components/authoring/dialog/childreneditor"
       name="./items" />

     - The name="./items" must match the node where child components are stored.
     - Mismatch = POST won't affect anything.



Avatar

Level 1

Hey !

Thank you for your response !

The url seems to be correct because when I copy and paste it in the CRX, I can reach the component in my page with its items...
Screenshot 2025-03-20 at 9.16.23 AM.png

I can add items and they appear correctly in the CRX.
In the point 2, you say "If it’s a proxy or sling:resourceType, POST will not work as expected". In my case, it is a sling:resourceType. Can you explain a bit more about this ?
on point 3, here is the childreneditor part inside my slider config dialog

<items jcr:primaryType="nt:unstructured">
    [...]
    <containerItems
        jcr:primaryType="nt:unstructured"
        sling:resourceType="/apps/twilio-foundation/components/content/slider/childreneditor"/>
</items>

is this seems to be correct ?
Also, can you expand a bit more on how I can debug point 4, 5 and 6 ?

Thanks again for your response ! Regards
Stephane

Avatar

Level 1

I have checked permissions, and in my case, I am using the admin account on a local instance of AEM. So in the `/useradmin` console, I can see that it has all permissions on every resources (this is clear)
So, according to me, it is not that