Expand my Community achievements bar.

SOLVED

Tags inside multifields

Avatar

Level 2

Hello,

I created in dialog a new multifields with text and tags field into the form.

I tried to select and save more than one tag inside the multifileds without succeed.

I notice that if I put the tag outside the multifields, everything works fine.

Below my code:

<tags

cq:showOnCreate="{Boolean}true"

jcr:primaryType="nt:unstructured"

sling:resourceType="cq/gui/components/common/tagspicker"

allowBulkEdit="{Boolean}true"

allowCreate="{Boolean}true"

cq-msm-lockable="cq:tags"

fieldLabel="Tags"

name="./cq:tags"  />

<geolocalizedText

  jcr:primaryType="nt:unstructured"

sling:resourceType="silversea/silversea-com/ui/components/foundation/form/multifields"

fieldLabel="Geolocalized Text">

<field

jcr:primaryType="nt:unstructured"

sling:resourceType="granite/ui/components/foundation/form/fieldset"

class="multifields-wrapper"

name="./geolocalized"

    <items jcr:primaryType="nt:unstructured">

<text

jcr:primaryType="nt:unstructured"

  sling:resourceType="granite/ui/components/foundation/form/textfield"

fieldLabel="Text"

name="text" />

<tags

cq:showOnCreate="{Boolean}true"

jcr:primaryType="nt:unstructured"

sling:resourceType="cq/gui/components/common/tagspicker"

allowBulkEdit="{Boolean}true"

allowCreate="{Boolean}true"

cq-msm-lockable="cq:tags"

fieldLabel="Tags"

name="tags"  />

</items>

</field>

</geolocalizedText>

The green one works with this output in crxde

cq:tags            String[]                 geotagging:eu, geotagging:as, geotagging:uk

The yellow one doesn’t work, it saves only the last selected tag:

geolocalized     String                {"text":"lblj","tags":"geotagging:uk","tags@TypeHint":"String[]","tags@Delete":""}

How can I possible to achieve my goal ?

Is there any workaround ?

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 6

Yes the link I mentioned in previous comment is developed on AEM 6.2

View solution in original post

4 Replies

Avatar

Level 6

OOTB multifield will not be able to slove this problem. we need an custom js file to solve this issue. This js has to handle both saving node to jcr and render it on dialog.

here is good example of doing similar approch on tags.

Experiencing Adobe Experience Manager - Day CQ: AEM 62 - Touch UI Nested ( Multi-Multi ) Composite M...

ref:

cq5 - AEM - xtype 'tags' within Multifield - Stack Overflow

Avatar

Level 2

Thank you mjb54261515.

Does this solution work with AEM 6.2 with granite UI ?

Avatar

Correct answer by
Level 6

Yes the link I mentioned in previous comment is developed on AEM 6.2