Does anyone have an example of a working multifield with a fieldset under 6.3? | Community
Skip to main content
Level 3
Mar 3, 2018 1:59 AM UTC
Solved

Does anyone have an example of a working multifield with a fieldset under 6.3?

I'm working on a 6.1 to 6.3 upgrade and every custom component we've written that uses a multifield is failing under 6.3. The "add field" button works. The data gets saved to the datastore. But the data can't be retrieved on edit. Here's the cq dialog xml code.

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/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="Image Gallery"
   sling:resourceType="cq/gui/components/authoring/dialog">
  <content
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/container">
  <layout
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/layouts/tabs"
   type="nav"/>
  <items jcr:primaryType="nt:unstructured">
  <presentation
   jcr:primaryType="nt:unstructured"
   jcr:title="Presentation"
   sling:resourceType="granite/ui/components/foundation/container">
  <layout
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"/>
  <items jcr:primaryType="nt:unstructured">
  <columns
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/container">
  <items jcr:primaryType="nt:unstructured">
  <galleryMode
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/form/select"
   fieldLabel="Gallery Mode"
   name="./galleryMode">
  <items jcr:primaryType="nt:unstructured">
  <item1
   jcr:primaryType="nt:unstructured"
   text="Carousel"
   value="carousel"/>
  <item2
   jcr:primaryType="nt:unstructured"
   text="Slideshow"
   value="slideshow"/>
  </items>
  </galleryMode>
  <captionMode
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/form/select"
   fieldLabel="Caption Mode"
   name="./captionMode">
  <items jcr:primaryType="nt:unstructured">
  <item1
   jcr:primaryType="nt:unstructured"
   text="Overlay"
   value="overlay"/>
  <item2
   jcr:primaryType="nt:unstructured"
   text="Grey Bar"
   value="greybar"/>
  </items>
  </captionMode>
  <interval
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/form/numberfield"
   fieldLabel="Gallery Interval"
   fieldDescription="Interval at which gallery changes images, in milliseconds"
   defaultValue="5000"
   name="./interval"/>
  <renditionHeight
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/form/numberfield"
   fieldLabel="Gallery Height (px)"
   fieldDescription="Set custom rendition height for images in gallery. Defaults to 500px."
   defaultValue="500"
   name="./renditionHeight"/>
  </items>
  </columns>
  </items>
  </presentation>
  <image_list
   jcr:primaryType="nt:unstructured"
   jcr:title="Image Gallery"
   sling:resourceType="granite/ui/components/foundation/container">
  <layout
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"/>
  <items jcr:primaryType="nt:unstructured">
  <columns
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/container">
  <items jcr:primaryType="nt:unstructured">
  <images
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/form/multifield"
   fieldLabel="Images"
   fieldDescription="Specify images for the carousel."
   nested-multifield="">
  <field
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/form/fieldset"
   name="./images">
  <items jcr:primaryType="nt:unstructured">
  <column
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/container">
  <items jcr:primaryType="nt:unstructured">
  <path
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/form/pathbrowser"
   class="touchui-nested-field"
   fieldLabel="Image Path"
   rootPath="/content/dam/ourapp"
   fieldDescription="Path to image asset"
   name="./path"/>
  <caption
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/form/textarea"
   class="touchui-nested-field"
   fieldLabel="Caption"
   fieldDescription="Overrides metadata caption value"
   name="./caption"/>
  <credit
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/foundation/form/textfield"
   class="touchui-nested-field"
   fieldLabel="Credit"
   fieldDescription="Overrides metadata credit value"
   name="./credit"/>
  </items>
  </column>
  </items>
  </field>
  </images>
  </items>
  </columns>
  </items>
  </image_list>
  </items>
  </content>
</jcr:root>

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
smacdonald2008
smacdonald2008Accepted solution
Level 10
Mar 5, 2018 2:24 PM UTC

For AEM 6.3 - use coral/granite data types. The multi-field in this article has the following fields based on Granite/Coral data types:

  • A text field based on granite/ui/components/coral/foundation/form/textfield.
  • A path field based on granite/ui/components/coral/foundation/form/pathfield.
  • A textarea picker based on granite/ui/components/coral/foundation/form/textarea.

Adobe Experience Manager Help | Creating a HTL Repeating Data Set 6.3 Component that uses Sling Models

12 replies

Ratna_Kumar
Level 10
Mar 6, 2018 2:56 AM UTC

Hi,

From AEM 6.3, coral3 is recommended.

Thanks,

Ratna Kumar.

Translate
Level 3
Mar 5, 2018 11:13 PM UTC

I finally found an example that works. Not sure what the difference is between that and earlier examples I've tried, even using Coral 3. In the example I got working locally I changed the resourceType of only the multifield and its children. Should the entirety of my custom component use Coral 3?         

Translate
smacdonald2008
Level 10
Mar 5, 2018 7:54 PM UTC

The solution is the most up to date resource tupes and the one you should use in 6.3.

Translate
smacdonald2008
Level 10
Mar 5, 2018 7:53 PM UTC

When you use granite/coral, you do not need ACS Commons.

Translate
Level 3
Mar 5, 2018 6:40 PM UTC

himanshusinghal​, That's the version of ACS Commons I'm using. Is there some kind of incompatibility with other commonly used libraries I should be aware of? Basically it writes the data to the datastore correctly, but it can't be retrieved when clicking back into "configure".     

Translate
Level 3
Mar 5, 2018 6:34 PM UTC

And to be clear, smacdonald2008​, your solution (reading the article) is only if you don't want to use acs-commons, correct?

Translate
Level 3
Mar 5, 2018 5:53 PM UTC

The article at aemcq5tutorials purports to work under 6.3 and it uses standard granite? Do I have to convert everything to coral 3 if I use the coral versions?    

Translate
Ratna_Kumar
Level 10
Mar 5, 2018 2:58 PM UTC

Hi,

Yes, Scott is right.

For AEM 6.3, use coral/granite data types.

We have HELPX community article as well of which Scott points out: Adobe Experience Manager Help | Creating a HTL Repeating Data Set 6.3 Component that uses Sling Models

Hope this helps!!

Thanks,

Ratna Kumar.

Translate
smacdonald2008
smacdonald2008Accepted solution
Level 10
Mar 5, 2018 2:24 PM UTC

For AEM 6.3 - use coral/granite data types. The multi-field in this article has the following fields based on Granite/Coral data types:

  • A text field based on granite/ui/components/coral/foundation/form/textfield.
  • A path field based on granite/ui/components/coral/foundation/form/pathfield.
  • A textarea picker based on granite/ui/components/coral/foundation/form/textarea.

Adobe Experience Manager Help | Creating a HTL Repeating Data Set 6.3 Component that uses Sling Models

Translate
Himanshu_Singhal
New Participant
Mar 5, 2018 11:29 AM UTC

Hi,

You can use the ACS commons latest package i.e. 3.14.6 which is well compatible with AEM 6.3 and it should work well for multifield.

Thanks,

Himanshu

Translate