<?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" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="cq:Dialog"
fieldLabel="Navigation"
title="dialog"
xtype="dialog">
<items
jcr:primaryType="cq:Widget"
xtype="tabpanel">
<items jcr:primaryType="cq:WidgetCollection">
<tools
jcr:primaryType="cq:Panel"
title="Tools"
xtype="panel">
<items jcr:primaryType="cq:WidgetCollection">
<tools_slides
jcr:primaryType="cq:Widget"
baseName="toolsitem_"
fieldLabel="Tools "
name="./toolsslides"
width="900"
xtype="multimulticompositefield">
<fieldConfigs jcr:primaryType="cq:WidgetCollection">
<sectionName
jcr:primaryType="cq:Widget"
allowBlank="{Boolean}false"
fieldLabel="Section Name"
name="sectionName"
width="840"
xtype="textfield"/>
<description
jcr:primaryType="cq:Widget"
fieldLabel="Description"
name="description"
width="840"
xtype="textfield"/>
<education_slides
jcr:primaryType="cq:Widget"
baseName="sectionelementsitem_"
fieldLabel="Tools Section Elements"
name="toolssectionelements"
width="800"
xtype="multimulticompositefield">
<fieldConfigs jcr:primaryType="cq:WidgetCollection">
<title
jcr:primaryType="cq:Widget"
allowBlank="{Boolean}false"
fieldLabel="Title"
name="title"
width="430"
xtype="textfield"/>
<linkType
jcr:primaryType="cq:Widget"
fieldLabel="New Window?"
name="linkType"
type="checkbox"
xtype="checkbox"/>
<iconUrl
jcr:primaryType="cq:Widget"
fieldLabel="Icon Image"
name="iconUrl"
width="430"
xtype="pathfield">
<treeRoot
jcr:primaryType="nt:unstructured"
name="content/dam"
text="Brocade DAM"/>
</iconUrl>
<description
jcr:primaryType="cq:Widget"
fieldLabel="Description"
name="description"
width="430"
xtype="textfield"/>
</fieldConfigs>
</education_slides>
</fieldConfigs>
</tools_slides>
</items>
</tools>
<education
jcr:primaryType="cq:Panel"
title="Education"
xtype="panel">
<items jcr:primaryType="cq:WidgetCollection">
<education_slides
jcr:primaryType="cq:Widget"
baseName="item_"
fieldLabel="Education"
name="./educationslides"
width="900"
xtype="multimulticompositefield">
<fieldConfigs jcr:primaryType="cq:WidgetCollection">
<section_name
jcr:primaryType="cq:Widget"
fieldLabel="Section"
name="section_name"
type="radiogroup"
width="840"
xtype="selection">
<options jcr:primaryType="cq:WidgetCollection">
<education
jcr:primaryType="nt:unstructured"
checked="{Boolean}true"
text="Education"
value="Education"/>
</options>
</section_name>
<title
jcr:primaryType="cq:Widget"
allowBlank="{Boolean}false"
fieldLabel="Title"
name="title"
width="840"
xtype="textfield"/>
<titleCode
jcr:primaryType="cq:Widget"
allowBlank="{Boolean}false"
fieldLabel="Title Code"
name="titleCode"
regex="/^[A-Za-z0-9-_/.]+$/"
regexText="Only alphanumeric with -, _ and / allowed."
width="840"
xtype="textfield">
<listeners
jcr:primaryType="nt:unstructured"
blur="function() {
	var inputs = {};
	var duplicate = false;
	$("input[name$='titleCode']").each(function() {
 if (inputs[this.value] !== undefined) {
 $([this, inputs[this.value]]).addClass('same');
 alert("Title Code should be unique: "+this.value)
		duplicate = true;
		return false;
 }
 inputs[this.value] = this;
	});
	if(duplicate) {
		return false;
	}else{		
		if(this.getValue() != ''){
			if(this.getValue().match(/^[A-Za-z0-9-_/.]+$/)){
				this.setReadOnly(true);
			}else{
				alert('Title Code should be alphanumerics, - and _ only');
			}			
		}
	}
}"/>
</titleCode>
<linkType
jcr:primaryType="cq:Widget"
fieldLabel="New Window?"
name="linkType"
type="checkbox"
xtype="checkbox"/>
<description
jcr:primaryType="cq:Widget"
fieldLabel="Description"
name="description"
width="840"
xtype="textfield"/>
</fieldConfigs>
</education_slides>
</items>
</education>
</items>
</items>
<listeners
jcr:primaryType="nt:unstructured"
beforesubmit="function(dialog) {
var duplicate = false;
var inputs = {};
	$("input[name$='titleCode']").each(function() {
 if (inputs[this.value] !== undefined) {
 $([this, inputs[this.value]]).addClass('same');
 alert("Title Code should be unique: "+this.value);
		duplicate = true;
		return false;
 }
 inputs[this.value] = this;	
	}); 
if(duplicate) {
	return false;
}
}"
loadcontent="function() { 
 $("input[name$='titleCode']").attr('readonly', true);
 $("input[name$='titleCode']").css({"background-color":"#EBEBE4", "color":"#ccc"});
}"/>
</jcr:root>
Views
Replies
Total Likes
Below are the two community article which uses nested multifiled, you can find may such articles, try to see how they works
Thanks
Views
Replies
Total Likes
Hi
Adding more references to learn nested-multifields.
Link:- http://experience-aem.blogspot.in/2015/03/aem-6-sp2-touch-ui-coral-ui-nested-multi-multifield.html [coral] DEMO
Link:- http://experience-aem.blogspot.in/2015/02/aem-6-sp2-touch-ui-multi-field-component.html [Touch] DEMO
Link:- https://helpx.adobe.com/experience-manager/using/nested_multifield.html
I hope this would help you.
Thanks and Regards
Kautuk Sahni
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies