profile
viewpoint

Ask questions[Carousel] use of children editor seems only possible with Carousel as supertype

Bug Report

Current Behavior I had create a new component, which is a "stupid" container holding some items. For comfortable managing of the items I decided to use the childreneditor.

Here is what the component looks like:

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
        cq:icon="multiple"
        cq:isContainer="{Boolean}true"
        jcr:primaryType="cq:Component"
        jcr:title="Value Bar"
        componentGroup="gf"/>

And this is the configuration for the component:

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:granite="http://www.adobe.com/jcr/granite/1.0"
          xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
          xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
          jcr:primaryType="nt:unstructured"
          jcr:title="Value Bar"
          sling:resourceType="cq/gui/components/authoring/dialog"
          extraClientlibs="[core.wcm.components.commons.editor.dialog.childreneditor.v1]">
    <content
        jcr:primaryType="nt:unstructured"
        sling:resourceType="granite/ui/components/coral/foundation/container">
        <items jcr:primaryType="nt:unstructured">
            <tabs
                jcr:primaryType="nt:unstructured"
                sling:resourceType="granite/ui/components/coral/foundation/tabs"
                maximized="{Boolean}true">
                <items jcr:primaryType="nt:unstructured"
                       sling:hideChildren="[properties]">
                    <items
                        jcr:primaryType="nt:unstructured"
                        jcr:title="Items"
                        sling:resourceType="granite/ui/components/coral/foundation/container"
                        margin="{Boolean}true">
                        <items jcr:primaryType="nt:unstructured">
                            <columns
                                jcr:primaryType="nt:unstructured"
                                sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns"
                                margin="{Boolean}true">
                                <items jcr:primaryType="nt:unstructured">
                                    <column
                                        jcr:primaryType="nt:unstructured"
                                        sling:resourceType="granite/ui/components/coral/foundation/container">
                                        <items jcr:primaryType="nt:unstructured">                                            
                                            <slides
                                                jcr:primaryType="nt:unstructured"
                                                sling:resourceType="core/wcm/components/commons/editor/dialog/childreneditor/v1/childreneditor"/>
                                        </items>
                                    </column>
                                </items>
                            </columns>
                        </items>
                    </items>
                </items>
            </tabs>
        </items>
    </content>
</jcr:root>

When i use this configuration, i got some errors when i use the childreneditor in the ui (add, reange or delete items):

Bildschirmfoto 2019-08-14 um 15 57 03

I searched for solutions for this error, but it seems a little bit to complicated to find the origin of it compared to only using standard components. In my opinion there is nothing too special or individual in this component.

To solve this problem, I had to add the following property to the component: sling:resourceSuperType="core/wcm/components/carousel/v1/carousel"

But than I had other issues (I would create another issue here if you guys say that I had to take the carousel as supertype).

Expected behavior/code/possible solutions There are multiple options:

  1. You guys say the childreneditor only works with the carousel as a supertype (but then I don't understand why it is not part of the carousel-implementation).
  2. It's a bug and hopefully you will work on it.
  3. This is not the right place for this issue because it's not part of the core components (maybe then it's an issue for daycare).
  4. There are some configuration-issues and it would be better to discuss this on another platform.

It would be great if you guys could be so honest to take the right number. I am new to AEM and the community (work on it for 1 month). Your work is great btw.

Environment

  • AEM version and patch level: 6.4.2.0
  • Core Components version: 2.5.0
adobe/aem-core-wcm-components

Answer questions msagolj

@PublicisMaikLindner first about your numbers :) :

  1. It's also used in Tabs and Accordion, that's why its in commons.
  2. No, its not a bug
  3. It's a core components related question so I would say you are at the right place :)
  4. I think its more a question of is it the right thing to use.

Second, as for your problem at hand, " i got some errors when i use the childreneditor in the ui (add, reange or delete items)", I think you are missing the cq:EditConfig node in your component. See e.g.: https://github.com/adobe/aem-core-wcm-components/tree/master/content/src/content/jcr_root/apps/core/wcm/components/carousel/v1/carousel#enabling-carousel-editing-functionality

But I guess this will not be the end of your problems because of what I mentioned in 4. above:

This Children Editor GUI element is meant to be used in conjunction with components that have a concept of panel containers, meaning they have children items, but only one of them is visible at a time for editing as its the case for Carousel, Tabs and Accordion. For this types we introduced this Children Editor GUI element so you can add, reorder, delete the children and give them a title for the container that can be displayed. They also have a switcher in der toolbar e.g.:

image

So unless your component has the same needs, i would suggest to simply use the normal container, or proxy from it.

Hope this answers your question and if so please close this issue.

useful!

Related questions

[Form Container] - Component Throws Error On Submission hot 1
source:https://uonfu.com/
Github User Rank List