Hi I'm using AEM 6.3 Touch-UI
This is the dailog.xml for multi field in separate column
This is the dynamic node structure item0, item1 and item2 created under page after I've authored the multi field component thrice...
I tried to pas the parameters through <sly data-sly-use.linkInfo="subLinkLogic.js" @ resPath = item.path>
with the below code, will the linkType property of the dynamic nodes is set to childLinkType ?
TIA
"use strict";
use(function () {
var locResPath = this.resPath;
granite.resource.resolve(locResPath).then(function(child) {
properties.resolve(child);
});
return properties;
var childLinkType = locResPath.properties.get("linkType");
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
As Scott stated, I too prefer sling models to work with Multifield in AEM 6.3.
And also, it is very easy as compared to WCMUsePOJO.
You can refer the article provided by Scott..It works nicely: Building Experience Manager Components using Granite/Coral Resource Types
Thanks,
Ratna Kumar.
Using a Multifield in AEM 6.3 is best when working with AEM Sling Models.
Building Experience Manager Components using Granite/Coral Resource Types
You use the @Inject annotation to inject the Multifield:
@Inject
@Optional
public
Resource products; //products corresponds to the multifield dialog node.
This shows you how to work with a MF and display the results in the component.
Using JavaSctipt to read a multifield is not best practice. Sling Models is much better.
Then you write out the values like this:
<
h2
>This is your AEM HTML Template Language component with a Multifield</
h2
>
<
div
data-sly-use.multiItems
=
"com.aem.summit.core.models.HeroSlingModel"
>
<
div
data-sly-list.head
=
"${multiItems.products.listChildren}"
>
<
p
><
b
>Description:</
b
> ${head.product}</
p
>
<
p
><
b
>Selected Path value:</
b
> ${head.pathbr}</
p
>
<
p
><
b
>Date:</
b
> ${'yyyy-MM-dd HH:mm:ss.SSSXXX' @ format= head.startDate, timezone='UTC'}</
p
>
<
p
><
b
>Country:</
b
> ${head.size}</
p
>
<
p
><
b
>CHeckbox:</
b
> ${head.show}</
p
>
<
p
><
b
>Fruit:</
b
> ${head.fruit}</
p
>
<
hr
>
</
div
>
</
div
>
Hi,
As Scott stated, I too prefer sling models to work with Multifield in AEM 6.3.
And also, it is very easy as compared to WCMUsePOJO.
You can refer the article provided by Scott..It works nicely: Building Experience Manager Components using Granite/Coral Resource Types
Thanks,
Ratna Kumar.
That actually worked, thank you
Views
Replies
Total Likes
Thats the purpose of the community articles - to show working examples. I am glad you got it working.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies