This conversation has been locked due to inactivity. Please create a new post.
This conversation has been locked due to inactivity. Please create a new post.
Hello, AEM Community
Could you help please?
I added multifield to my dialog:
<overrideParentalRatingDisplay
jcr:primaryType="nt:unstructured"
sling:resourceType="orion2/components/ui/components/foundation/form/multifield"
composite="{Boolean}true">
<field
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/container"
name="./settings/overrideParentalRatingDisplay">
<items jcr:primaryType="nt:unstructured">
<key
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/numberfield"
name="./key"/>
<value
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/textfield"
name="./value"/>
</items>
</field>
<granite:data
jcr:primaryType="nt:unstructured"
cq-msm-lockable="settings/overrideParentalRatingDisplay"/>
</overrideParentalRatingDisplay>
In crx result looks like this:
I want multifield node to be deleted if e.g. item0, item1 will be deleted. I added:
<overrideParentalRatingDisplay-Delete
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/hidden"
value="{Boolean}true"
name="./settings/overrideParentalRatingDisplay@Delete"/>
But it doesn't work. Empty node stayed:
Do I do something wrong or some different solution exist?
I created multifield component - orion2/components/ui/components/foundation/form/multifield, because multifield situated in libs doesn't support composite multifields.
AEM 6.3
Thanks.
Solved! Go to Solution.
Hi, Arun Patidar
Thanks for your answer.
It was not deleted because overrideParentalRatingDisplay has two more things:
<multifieldProperty
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/hidden"
name="./settings/overrideParentalRatingDisplay/multifieldProperty"
value="overrideParentalRatingDisplay"/>
<multifieldProperty-converterType
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/hidden"
name="./settings/overrideParentalRatingDisplay/multifieldProperty-converterType"
value="MULTIFIELD_PROPERTY"/>
So, if node doesn't have child nodes, it isn't deleted because of these properties. I need these properties for our backend functionality. I decided to leave them and not to delete empty node (it isn't critical).
But if you have an idea how to delete empty node with these properties, it'll be great.
Thanks.
Hi,
Multifield does support composite. Seems you are using Coral2 resourceType, you should be using Coral3(Granite) type
granite/ui/components/coral/foundation/form/multifield
Hi, Arun Patidar
Thanks for your answer.
I really don't know why it is so. But our envs have "granite/ui/components/coral/foundation/form/multifield" , where there isn't implementation for "composite". That's why I put implementation with composite and it has superType "granite/ui/components/coral/foundation/form/multifield".
Views
Replies
Total Likes
Hi, Arun Patidar
Thanks for your answer.
It was not deleted because overrideParentalRatingDisplay has two more things:
<multifieldProperty
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/hidden"
name="./settings/overrideParentalRatingDisplay/multifieldProperty"
value="overrideParentalRatingDisplay"/>
<multifieldProperty-converterType
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/hidden"
name="./settings/overrideParentalRatingDisplay/multifieldProperty-converterType"
value="MULTIFIELD_PROPERTY"/>
So, if node doesn't have child nodes, it isn't deleted because of these properties. I need these properties for our backend functionality. I decided to leave them and not to delete empty node (it isn't critical).
But if you have an idea how to delete empty node with these properties, it'll be great.
Thanks.
you can write a Listener on child node delete event and check parent node has no children then delete parent node as well.
or write a sling scheduler to check an empty node and clear periodically.
Thanks.
Views
Replies
Total Likes