<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Touch UI Archives - Sourced Code</title>
	<atom:link href="https://sourcedcode.com/blog/category/aem/touch-ui/feed" rel="self" type="application/rss+xml" />
	<link>https://sourcedcode.com</link>
	<description>AEM Blog Made Just for You.</description>
	<lastBuildDate>Sun, 03 Dec 2023 21:29:20 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.8</generator>

<image>
	<url>https://sourcedcode.com/wp-content/uploads/2019/09/cropped-favicon-32x32.png</url>
	<title>Touch UI Archives - Sourced Code</title>
	<link>https://sourcedcode.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Granite UI, Touch UI helpPath</title>
		<link>https://sourcedcode.com/blog/aem/granite-ui-touch-ui-helppath</link>
					<comments>https://sourcedcode.com/blog/aem/granite-ui-touch-ui-helppath#respond</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Mon, 28 Aug 2023 05:37:20 +0000</pubDate>
				<category><![CDATA[AEM]]></category>
		<category><![CDATA[Author]]></category>
		<category><![CDATA[Touch UI]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=5981</guid>

					<description><![CDATA[<p>helpPath typically refers to a configuration property that defines the path to the location where help content or documentation is stored within the AEM repository. The helpPath configuration property is often used in AEM components or templates to specify the location where users can access contextual help documentation related to the specific component or template. [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/granite-ui-touch-ui-helppath">Granite UI, Touch UI helpPath</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><span class="code-highlight-primary">helpPath</span> typically refers to a configuration property that defines the path to the location where help content or documentation is stored within the AEM repository.</p>
<p>The <span class="code-highlight-primary">helpPath</span> configuration property is often used in AEM components or templates to specify the location where users can access contextual help documentation related to the specific component or template. This can be helpful for content authors and administrators who need guidance on how to use certain features or elements within the AEM interface.</p>
<p>By setting the <span class="code-highlight-primary">helpPath</span> property, you provide a reference to the relevant documentation that users can access directly from the AEM interface, making it easier for them to understand and work with different components and features. Clicking on the help path will redirect the author to documentation which may be useful for them to understand how the component works as expected.</p>
<p><a href="https://sourcedcode.com/wp-content/uploads/2023/08/teaser-component-helpPath.png"><img fetchpriority="high" decoding="async" src="https://sourcedcode.com/wp-content/uploads/2023/08/teaser-component-helpPath.png" alt="helpPath Granite Ui, Touch UI" width="1258" height="448" class="alignnone size-full wp-image-5995" srcset="https://sourcedcode.com/wp-content/uploads/2023/08/teaser-component-helpPath.png 1258w, https://sourcedcode.com/wp-content/uploads/2023/08/teaser-component-helpPath-300x107.png 300w, https://sourcedcode.com/wp-content/uploads/2023/08/teaser-component-helpPath-1024x365.png 1024w, https://sourcedcode.com/wp-content/uploads/2023/08/teaser-component-helpPath-768x274.png 768w, https://sourcedcode.com/wp-content/uploads/2023/08/teaser-component-helpPath-600x214.png 600w" sizes="(max-width: 1258px) 100vw, 1258px" /></a></p>
<p>Keep in mind that the exact implementation and usage of <span class="code-highlight-primary">helpPath</span> can vary based on the specific version of AEM and the customizations made by the organization. Always refer to the official AEM documentation or any relevant resources specific to your version of AEM for the most accurate and up-to-date information.</p>
<hr class="spacer-larger" />
<h3>Example Code</h3>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #339933;">&lt;</span>jcr<span style="color: #339933;">:</span>root xmlns<span style="color: #339933;">:</span>sling<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://sling.apache.org/jcr/sling/1.0&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xmlns<span style="color: #339933;">:</span>jcr<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.jcp.org/jcr/1.0&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xmlns<span style="color: #339933;">:</span>nt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.jcp.org/jcr/nt/1.0&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xmlns<span style="color: #339933;">:</span>cq<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.day.com/jcr/cq/1.0&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xmlns<span style="color: #339933;">:</span>granite<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.adobe.com/jcr/granite/1.0&quot;</span><br />
&nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; jcr<span style="color: #339933;">:</span>title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;My Custom Component&quot;</span><br />
&nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;cq/gui/components/authoring/dialog&quot;</span><br />
&nbsp; &nbsp; extraClientlibs<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;[myproject.components.mycustomcomponent.editor]&quot;</span><br />
&nbsp; &nbsp; helpPath<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/content/myproject/help/mycustomcomponent.html&quot;</span><br />
&nbsp; &nbsp; trackingFeature<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;myproject:mycustomcomponent&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;!--</span> Define your component<span style="color: #0000ff;">'s dialog structure here --&gt;<br />
&lt;/jcr:root&gt;</span></div></td></tr></tbody></table></div>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/granite-ui-touch-ui-helppath">Granite UI, Touch UI helpPath</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/granite-ui-touch-ui-helppath/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Sling Resource Merging Properties</title>
		<link>https://sourcedcode.com/blog/aem/sling-resource-merging-properties</link>
					<comments>https://sourcedcode.com/blog/aem/sling-resource-merging-properties#respond</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Sun, 27 Aug 2023 04:23:10 +0000</pubDate>
				<category><![CDATA[AEM]]></category>
		<category><![CDATA[Touch UI]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=5970</guid>

					<description><![CDATA[<p>In the realm of AEM developers have a powerful tool at their disposal that allows for seamless customization—Sling Resource Merging. This feature might sound a bit technical, but fear not! In this article, we&#8217;ll break down the key aspects of Sling Resource Merging and delve into its properties, showing you how they can simplify your [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/sling-resource-merging-properties">Sling Resource Merging Properties</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In the realm of AEM developers have a powerful tool at their disposal that allows for seamless customization—Sling Resource Merging. This feature might sound a bit technical, but fear not! In this article, we&#8217;ll break down the key aspects of Sling Resource Merging and delve into its properties, showing you how they can simplify your development process.</p>
<div class="mention-block">
    <strong>Quick Links:</strong></p>
<ul>
<li><a href="#deeper-look">1. A Deeper Look at Sling Resource Merging</a></li>
<li><a href="#demystifying-slingresource">2. Demystifying Sling Resource Merging Properties</a>
<ul>
<li><a href="#hideProperties">2.1. sling:hideProperties (String or String[])</a></li>
<li><a href="#hideResource">2.2. sling:hideResource (Boolean)</a></li>
<li><a href="#hideChildren">2.3. sling:hideChildren (String or String[])</a></li>
<li><a href="#orderBefore">2.4. sling:orderBefore (String)</a></li>
</ul>
</li>
<li><a href="#real-world-applications">3. Real-world Applications of These Properties</a></li>
<li><a href="#wrapping-up">4. Wrapping Up</a></li>
</ul>
</div>
<hr class="spacer-larger"/>
<h2 id="deeper-look">1. A Deeper Look at Sling Resource Merging</h2>
<p>Sling Resource Merging is like a code-friendly puzzle solver—it lets you combine resources and properties from different locations without getting tangled up. This is especially handy when you&#8217;re looking to make specific changes without messing around in the core functionalities stored in `/libs`. Let&#8217;s dive into the properties that make this process smoother.</p>
<hr class="spacer-larger"/>
<h2 id="demystifying-slingresource">2. Demystifying Sling Resource Merging Properties</h2>
<h3 id="essentials">Here&#8217;s a rundown of the essential properties you&#8217;ll encounter:</h3>
<hr class="spacer" style="background: none;"/>
<h4 id="hideProperties" style="margin-top:60px;">2.1. sling:hideProperties (String or String[])</h4>
<p>This property allows you to hide certain properties that you don&#8217;t want to see. Whether you specify a single property or an array of properties, they&#8217;ll vanish from sight. The wildcard `*` works like magic—it hides everything except what you choose; Specifies the property, or list of properties, to hide.The wildcard * hides all.</p>
<p><strong>Example:</strong></p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #339933;">&lt;</span>linkAriaLabel<br />
&nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; sling<span style="color: #339933;">:</span>hideProperties<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;[linkAriaLabel]&quot;</span><br />
&nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/form/textfield&quot;</span><br />
&nbsp; &nbsp; fieldDescription<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;This aria label will be used for the link.&quot;</span><br />
&nbsp; &nbsp; fieldLabel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Link Aria Label&quot;</span><br />
&nbsp; &nbsp; emptyText<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Link Aria Label&quot;</span><br />
&nbsp; &nbsp; name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;./linkAriaLabel&quot;</span><span style="color: #339933;">/&gt;</span></div></td></tr></tbody></table></div>
<hr class="spacer" style="background: none;"/>
<h4 id="hideResource" style="margin-top:60px;">2.2. sling:hideResource (Boolean)</h4>
<p>When set to `true`, this property hides a resource entirely, including its children. Think of it as a way to temporarily pull a curtain over a specific resource when you need it out of sight; Indicates whether the resources should be completely hidden, including its children.</p>
<p><strong>Example:</strong> In this example, we are hiding linkAriaLabel from being rendered on the view.</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #339933;">&lt;</span>linkAriaLabel<br />
&nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; sling<span style="color: #339933;">:</span>hideResource<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{Boolean}true&quot;</span><br />
&nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/form/textfield&quot;</span><br />
&nbsp; &nbsp; fieldDescription<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;This aria label will be used for the link.&quot;</span><br />
&nbsp; &nbsp; fieldLabel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Link Aria Label&quot;</span><br />
&nbsp; &nbsp; emptyText<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Link Aria Label&quot;</span><br />
&nbsp; &nbsp; name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;./linkAriaLabel&quot;</span><span style="color: #339933;">/&gt;</span></div></td></tr></tbody></table></div>
<hr class="spacer" style="background: none;"/>
<h4 id="hideChildren" style="margin-top:60px;">2.3. sling:hideChildren (String or String[])</h4>
<p>Unlike the previous property, this one selectively hides child nodes while preserving their properties. Whether you&#8217;re hiding one or using `*` to hide them all, the properties stay untouched; Contains the child node, or list of child nodes, to hide. The properties of the node will be maintained. The wildcard * hides all.</p>
<p><strong>Example:</strong> In this example, all children Granite UI fields are hidden from the view.</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #339933;">&lt;</span>fixedcolums<br />
&nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/fixedcolumns&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>items jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>hideChildren<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;*&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>properties<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/container&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>items jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>pageTitle<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/form/text&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ..<span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>description<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/form/text&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ..<span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>items<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>properties<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>items<span style="color: #339933;">&gt;</span><br />
<span style="color: #339933;">&lt;/</span>fixedcolums<span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div>
<hr class="spacer" style="background: none;"/>
<h4 id="orderBefore" style="margin-top:60px;">2.4. sling:orderBefore (String)</h4>
<p>This property will force the Granite UI to render before a specific element. In this example, we are forcing the linkAriaLabel to render before the &#8220;title&#8221; Granite UI; Contains the name of the sibling node that the current node should be positioned in front of.</p>
<p><strong>Example:</strong></p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #339933;">&lt;</span>title<br />
&nbsp; &nbsp; &nbsp;....<span style="color: #339933;">/&gt;</span><br />
<span style="color: #339933;">&lt;</span>linkAriaLabel<br />
&nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; sling<span style="color: #339933;">:</span>orderBefore<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;title&quot;</span><br />
&nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/form/textfield&quot;</span><br />
&nbsp; &nbsp; fieldDescription<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;This aria label will be used for the link.&quot;</span><br />
&nbsp; &nbsp; fieldLabel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Link Aria Label&quot;</span><br />
&nbsp; &nbsp; emptyText<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Link Aria Label&quot;</span><br />
&nbsp; &nbsp; name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;./linkAriaLabel&quot;</span><span style="color: #339933;">/&gt;</span></div></td></tr></tbody></table></div>
<hr class="spacer-larger"/>
<h2 id="real-world-applications">3. Real-world Applications of These Properties</h2>
<h3>Let&#8217;s translate these properties into practical scenarios:</h3>
<ol>
<li><strong>Tailored Component Styling</strong>: Say you have a core component in `/libs` with default styles. Use `sling:hideProperties` to conceal unnecessary styles and introduce your own in `/apps`. This way, you retain the core functionality while customizing the look.</li>
<li><strong>Conditional Rendering</strong>: For situations where you need to show or hide an entire component, `sling:hideResource` is your ally. It&#8217;s like having a switch to control whether a component and its children should be displayed based on specific conditions.</li>
<li><strong>Optimized Content Arrangement</strong>: Use `sling:orderBefore` to reposition components within a container. This property is particularly helpful for responsive designs, ensuring content displays flawlessly on various devices.</li>
</ol>
<hr class="spacer-larger"/>
<h2 id="wrapping-up">4. Wrapping Up</h2>
<p>Sling Resource Merging isn&#8217;t a mysterious incantation—it&#8217;s a tool that simplifies your AEM development journey. By getting acquainted with properties like `sling:hideProperties`, `sling:hideResource`, `sling:hideChildren`, and `sling:orderBefore`, you&#8217;re equipped to wield customization powers without the fuss. So go ahead, explore, and let Sling Resource Merging elevate your AEM development game!</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/sling-resource-merging-properties">Sling Resource Merging Properties</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/sling-resource-merging-properties/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Granite UI, Touch UI trackingFeature</title>
		<link>https://sourcedcode.com/blog/aem/granite-ui-touch-ui-trackingfeature</link>
					<comments>https://sourcedcode.com/blog/aem/granite-ui-touch-ui-trackingfeature#respond</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Tue, 15 Aug 2023 05:42:35 +0000</pubDate>
				<category><![CDATA[AEM]]></category>
		<category><![CDATA[Touch UI]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=5985</guid>

					<description><![CDATA[<p>In Adobe Experience Manager (AEM), the terms &#8220;tracking code&#8221; and &#8220;tracking feature&#8221; are used to refer to elements that help you gather analytics data about the usage and performance of components or features within your AEM instance. Let&#8217;s break down what each term means: 1. Tracking Code The term &#8220;tracking code&#8221; generally refers to a [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/granite-ui-touch-ui-trackingfeature">Granite UI, Touch UI trackingFeature</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In Adobe Experience Manager (AEM), the terms &#8220;tracking code&#8221; and &#8220;tracking feature&#8221; are used to refer to elements that help you gather analytics data about the usage and performance of components or features within your AEM instance. Let&#8217;s break down what each term means:</p>
<hr class="spacer-larger" />
<h2>1. Tracking Code</h2>
<p>The term &#8220;tracking code&#8221; generally refers to a piece of code or configuration that is used to collect data about user interactions and behaviors on a website or web application. This data can include information such as page views, clicks, form submissions, and more. In the context of AEM, tracking code can refer to the code or configuration that integrates with analytics tools like Adobe Analytics (formerly known as SiteCatalyst) to capture user data and generate insights about how users are interacting with your AEM-powered websites and digital experiences.</p>
<p>AEM allows you to integrate tracking codes into your templates, components, and pages so that you can measure the effectiveness and performance of your content and features. This data can be used to make informed decisions about content optimization, user experience enhancements, and marketing strategies.</p>
<hr class="spacer-larger" />
<h2>Tracking Feature</h2>
<p>The term &#8220;tracking feature&#8221; in AEM typically refers to a mechanism that enables you to associate analytics tracking with specific components or features within your AEM implementation. This feature helps you monitor and gather data about how users interact with those components or features. The term &#8220;tracking feature&#8221; might be specific to certain versions of AEM or certain projects, as it may not be an official Adobe term.</p>
<p>For example, a &#8220;tracking feature&#8221; could allow you to measure how many times a particular video component is viewed, how often a specific form is submitted, or how users interact with a custom navigation menu. By adding a tracking feature to a component, you can gain insights into user engagement and behavior related to that component.</p>
<p>In the previous example XML you provided, the `trackingFeature` attribute is used to define a tracking feature for a custom component. This attribute value could be used to identify and track interactions specifically related to the &#8220;My Custom Component.&#8221;</p>
<p>Please note that while I can provide information based on my knowledge up until September 2021, specific terms and implementations might have evolved in newer versions of AEM. Always refer to the official AEM documentation and resources specific to your version for the most accurate and up-to-date information.</p>
<hr class="spacer-larger" />
<h2>Implementation</h2>
<p>If you&#8217;re looking to implement tracking for components in AEM, you generally need to integrate with a third-party analytics platform like Adobe Analytics, Google Analytics, or any other analytics tool of your choice. Here&#8217;s a general outline of how you might approach setting up tracking for components:</p>
<ol>
<li><strong>Choose an Analytics Tool:</strong><br />
   Select an analytics tool that fits your needs. Adobe Analytics (formerly SiteCatalyst) is commonly used with AEM, but other tools like Google Analytics are also popular.</li>
<li><strong>Obtain Tracking Code:</strong><br />
   For the selected analytics tool, obtain the tracking code or configuration that needs to be added to your AEM pages.</li>
<li><strong>Implement Tracking Code:</strong><br />
   Integrate the tracking code into your AEM templates or components. You might need to add JavaScript snippets, tags, or configuration data to enable tracking.</li>
<li><strong>Identify Component Interactions:</strong><br />
   Determine what interactions you want to track for your components. This could include clicks on specific buttons, form submissions, video views, etc.</li>
<li><strong>Custom Events or Tracking Calls:</strong><br />
   Implement custom JavaScript events or tracking calls within your components to trigger the analytics tracking when specific interactions occur.</li>
<li><strong>Testing and Validation:</strong><br />
   Test the tracking implementation to ensure that data is being captured accurately. Use the analytics tool&#8217;s reporting interface to verify that the tracking data is being recorded as expected.</li>
</ol>
<p>Please consult your organization&#8217;s guidelines or documentation to understand if the term `trackingFeature` has a specific meaning or if there are custom tracking mechanisms they have set up. Additionally, refer to the documentation of the analytics tool you&#8217;re using to learn how to integrate tracking with AEM components effectively.</p>
<p>As of my last update, there might have been developments or changes in AEM and related tools, so I recommend checking the official documentation for the latest information and best practices.</p>
<hr class="spacer-larger" />
<h2>Example Code</h2>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #339933;">&lt;</span>jcr<span style="color: #339933;">:</span>root xmlns<span style="color: #339933;">:</span>sling<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://sling.apache.org/jcr/sling/1.0&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xmlns<span style="color: #339933;">:</span>jcr<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.jcp.org/jcr/1.0&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xmlns<span style="color: #339933;">:</span>nt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.jcp.org/jcr/nt/1.0&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xmlns<span style="color: #339933;">:</span>cq<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.day.com/jcr/cq/1.0&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xmlns<span style="color: #339933;">:</span>granite<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.adobe.com/jcr/granite/1.0&quot;</span><br />
&nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; jcr<span style="color: #339933;">:</span>title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;My Custom Component&quot;</span><br />
&nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;cq/gui/components/authoring/dialog&quot;</span><br />
&nbsp; &nbsp; extraClientlibs<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;[myproject.components.mycustomcomponent.editor]&quot;</span><br />
&nbsp; &nbsp; helpPath<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/content/myproject/help/mycustomcomponent.html&quot;</span><br />
&nbsp; &nbsp; trackingFeature<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;myproject:mycustomcomponent&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;!--</span> Define your component<span style="color: #0000ff;">'s dialog structure here --&gt;<br />
&lt;/jcr:root&gt;</span></div></td></tr></tbody></table></div>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/granite-ui-touch-ui-trackingfeature">Granite UI, Touch UI trackingFeature</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/granite-ui-touch-ui-trackingfeature/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Enable AEM Style System Configuration for Components</title>
		<link>https://sourcedcode.com/blog/aem/how-to-enable-aem-style-system-configuration-for-components</link>
					<comments>https://sourcedcode.com/blog/aem/how-to-enable-aem-style-system-configuration-for-components#respond</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Sun, 30 Apr 2023 22:32:28 +0000</pubDate>
				<category><![CDATA[AEM]]></category>
		<category><![CDATA[Touch UI]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=4750</guid>

					<description><![CDATA[<p>AEM Style System enables a user-friendly interface, for non-technical users who can easily make style adjustments, fostering creativity and agility. Integrating seamlessly with Adobe Experience Manager, the AEM Style System enables content authors to apply predefined styles effortlessly, maintaining brand consistency across platforms and devices. As developers are trying to create new AEM component&#8217;s this [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/how-to-enable-aem-style-system-configuration-for-components">How to Enable AEM Style System Configuration for Components</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>AEM Style System enables a user-friendly interface, for non-technical users who can easily make style adjustments, fostering creativity and agility. Integrating seamlessly with Adobe Experience Manager, the AEM Style System enables content authors to apply predefined styles effortlessly, maintaining brand consistency across platforms and devices. As developers are trying to create new AEM component&#8217;s this feature must be enabled in order to utilize the AEM Style System feature.</p>
<p>In this blog article, I will be showing you how to enable AEM Style System for your component it&#8217;s frankly just a configuration from the<br />
cq_design_dialog or as developers know it, _cq_design_dialog/.context.html.</p>
<hr class="spacer-large"/>
<h3>1. Disabled Style System</h3>
<p>Without the Style System enabled for a component, the component policies page would look like this:<br />
<a href="https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-without-enabled-feature.png"><img decoding="async" src="https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-without-enabled-feature.png" alt="AEM Style System, not yet configured; default experience" width="2406" height="1460" class="alignnone size-full wp-image-4751" srcset="https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-without-enabled-feature.png 2406w, https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-without-enabled-feature-300x182.png 300w, https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-without-enabled-feature-1024x621.png 1024w, https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-without-enabled-feature-768x466.png 768w, https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-without-enabled-feature-1536x932.png 1536w, https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-without-enabled-feature-2048x1243.png 2048w, https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-without-enabled-feature-600x364.png 600w" sizes="(max-width: 2406px) 100vw, 2406px" /></a></p>
<hr class="spacer-large"/>
<h3>2. Adding code configurations</h3>
<p>The quickest explanation of why the style system is not visible in the component&#8217;s policies is that you have a missing configuration for the cq_design_dialog. In the instructions below, we will include some code configurations to enable your target component&#8217;s AEM Style System feature. </p>
<ol>
<li>Create a “_cq_design_dialog” folder under /apps/sourcedcode/components/examplecomponent</li>
<li>Create a “.content.xml” file under /apps/sourcedcode/components/examplecomponent/_cq_design_dialog with the file contents below:</li>
<li>Line:15-18 is the code block you should include in the _cq_design_dialog/.content.xml.
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #339933;">&lt;?</span>xml version<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1.0&quot;</span> encoding<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;UTF-8&quot;</span><span style="color: #339933;">?&gt;</span><br />
<span style="color: #339933;">&lt;</span>jcr<span style="color: #339933;">:</span>root xmlns<span style="color: #339933;">:</span>sling<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://sling.apache.org/jcr/sling/1.0&quot;</span> xmlns<span style="color: #339933;">:</span>cq<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.day.com/jcr/cq/1.0&quot;</span> xmlns<span style="color: #339933;">:</span>jcr<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.jcp.org/jcr/1.0&quot;</span> xmlns<span style="color: #339933;">:</span>nt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.jcp.org/jcr/nt/1.0&quot;</span><br />
&nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; jcr<span style="color: #339933;">:</span>title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Example Component&quot;</span><br />
&nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;cq/gui/components/authoring/dialog&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>content<br />
&nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/container&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>items jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>tabs<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/tabs&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; maximized<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{Boolean}true&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>items jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>styletab<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/include&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; path<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/mnt/overlay/cq/gui/components/authoring/dialog/style/tab_design/styletab&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>items<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>tabs<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>items<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>content<span style="color: #339933;">&gt;</span><br />
<span style="color: #339933;">&lt;/</span>jcr<span style="color: #339933;">:</span>root<span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div>
</li>
<li>We are utilizing the out-of-the-box AEM utils &#8220;/mnt/overlay/cq/gui/components/authoring/dialog/style/tab_design/styletab&#8221;, which enables the AEM Style System feature for your target component.</li>
<li>As a result, you should see something like this now. Make sure you configure the input fields indicated in red, and then continue on with the next instructions of this list. <a href="https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-with-enabled-feature-lined.png"><img decoding="async" src="https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-with-enabled-feature-lined.png" alt="AEM Style System, configured" width="2412" height="1462" class="alignnone size-full wp-image-4761" srcset="https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-with-enabled-feature-lined.png 2412w, https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-with-enabled-feature-lined-300x182.png 300w, https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-with-enabled-feature-lined-1024x621.png 1024w, https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-with-enabled-feature-lined-768x466.png 768w, https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-with-enabled-feature-lined-1536x931.png 1536w, https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-with-enabled-feature-lined-2048x1241.png 2048w, https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-with-enabled-feature-lined-600x364.png 600w" sizes="(max-width: 2412px) 100vw, 2412px" /></a></li>
<li>When editing the component, you should see a &#8220;paintbrush&#8221; indicating that the style system configuration is working as expected. Click on it, and you should see the style configurations that we have configured in step 5.<a href="https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-with-enabled-feature-inline-lined.png"><img loading="lazy" decoding="async" src="https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-with-enabled-feature-inline-lined.png" alt="AEM Style System, configured; inline editing experience" width="1170" height="566" class="alignnone size-full wp-image-4762" srcset="https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-with-enabled-feature-inline-lined.png 1170w, https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-with-enabled-feature-inline-lined-300x145.png 300w, https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-with-enabled-feature-inline-lined-1024x495.png 1024w, https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-with-enabled-feature-inline-lined-768x372.png 768w, https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-with-enabled-feature-inline-lined-600x290.png 600w" sizes="(max-width: 1170px) 100vw, 1170px" /></a></li>
<li>Done</li>
</ol>
<hr class="spacer-large"/>
<h3>Add AEM Style System in Touch UI (popup)</h3>
<p>Though we have configured and enabled the AEM Style System in the cq_design_dialog, the &#8220;Styles&#8221; option will only be visible in the &#8220;inline&#8221; edit mode for the target component. From the Touch UI (popup), the &#8220;Styles&#8221; tab will not be visible for the popup experience (when authors have clicked on the configure button for a target component). In this next section, we will add a piece of code to make the &#8220;Styles&#8221; tab visible, so content authors can configure the AEM Style System for the Touch UI &#8220;popup&#8221; experience.</p>
<ol>
</li>
<li>Edit your already existing cq_dialog, under _cq_dialog/.content.xml.</li>
<li>Add this line of code:
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #339933;">&lt;</span>styletab<br />
&nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/include&quot;</span><br />
&nbsp; &nbsp; path<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/mnt/overlay/cq/gui/components/authoring/dialog/style/tab_edit/styletab&quot;</span><span style="color: #339933;">/&gt;</span></div></td></tr></tbody></table></div>
</li>
<li>We are utilizing the out-of-the-box AEM utils &#8220;/mnt/overlay/cq/gui/components/authoring/dialog/style/tab_edit/styletab&#8221;, which enables the AEM Style System feature for your target component.</li>
<li><strong>Skip this part, it&#8217;s just extra details</strong> &#8211; I wanted to show you an example of the completed configuration file of the _cq_dialog/.content.xml, given in step 2, this line of code only works when your AEM touch UI follows is configured with tabs. line:42-45 is where you can find the exact code that has been mentioned in step 2.
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #339933;">&lt;?</span>xml version<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1.0&quot;</span> encoding<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;UTF-8&quot;</span><span style="color: #339933;">?&gt;</span><br />
<span style="color: #339933;">&lt;</span>jcr<span style="color: #339933;">:</span>root xmlns<span style="color: #339933;">:</span>sling<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://sling.apache.org/jcr/sling/1.0&quot;</span> xmlns<span style="color: #339933;">:</span>cq<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.day.com/jcr/cq/1.0&quot;</span> xmlns<span style="color: #339933;">:</span>jcr<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.jcp.org/jcr/1.0&quot;</span> xmlns<span style="color: #339933;">:</span>nt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.jcp.org/jcr/nt/1.0&quot;</span><br />
&nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; jcr<span style="color: #339933;">:</span>title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Example Component&quot;</span><br />
&nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;cq/gui/components/authoring/dialog&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>content<br />
&nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/container&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>items jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>tabs<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/tabs&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>items jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>tab1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Tab 1&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/container&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; margin<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{Boolean}true&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>items jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>columns<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/fixedcolumns&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; margin<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{Boolean}true&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>items jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>column<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/container&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>items jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>graniteExample1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/form/textfield&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldDescription<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Just an example&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldLabel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;graniteExample1&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;./graniteExample1&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; required<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{Boolean}false&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>items<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>column<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>items<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>columns<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>items<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>tab1<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>styletab<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/include&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; path<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/mnt/overlay/cq/gui/components/authoring/dialog/style/tab_edit/styletab&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>items<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>tabs<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>items<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>content<span style="color: #339933;">&gt;</span><br />
<span style="color: #339933;">&lt;/</span>jcr<span style="color: #339933;">:</span>root<span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div>
</li>
<li><strong>The result:</strong> <a href="https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-with-enabled-feature-touch-ui-lined-1.png"><img loading="lazy" decoding="async" src="https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-with-enabled-feature-touch-ui-lined-1.png" alt="AEM Style System with Touch UI (popup) options" width="1370" height="898" class="alignnone size-full wp-image-4763" srcset="https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-with-enabled-feature-touch-ui-lined-1.png 1370w, https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-with-enabled-feature-touch-ui-lined-1-300x197.png 300w, https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-with-enabled-feature-touch-ui-lined-1-1024x671.png 1024w, https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-with-enabled-feature-touch-ui-lined-1-768x503.png 768w, https://sourcedcode.com/wp-content/uploads/2023/04/component-poliices-with-enabled-feature-touch-ui-lined-1-600x393.png 600w" sizes="(max-width: 1370px) 100vw, 1370px" /></a></li>
</ol>
<hr class="spacer-large"/>
<h3>Last Thoughts</h3>
<p>Enabling the AEM Style System is actually quite simple, but however, sometimes as a developer, you would like to access the configured properties fro the backend code to compute and execute code conditionally on what is configured. To learn how to obtain the style system AEM component configuration In the backend code, take a look at this blog, <a href="https://sourcedcode.com/blog/aem/aem-style-system-component-information-with-code-sling-models">AEM Style System Component Information with Code Sling Models</a>.</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/how-to-enable-aem-style-system-configuration-for-components">How to Enable AEM Style System Configuration for Components</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/how-to-enable-aem-style-system-configuration-for-components/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>AEM Touch UI (Granite UI) Tabs: Example Code</title>
		<link>https://sourcedcode.com/blog/aem/aem-touch-ui-granite-ui-tabs-example-code</link>
					<comments>https://sourcedcode.com/blog/aem/aem-touch-ui-granite-ui-tabs-example-code#respond</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Fri, 28 Apr 2023 23:31:30 +0000</pubDate>
				<category><![CDATA[AEM]]></category>
		<category><![CDATA[Quick Reference]]></category>
		<category><![CDATA[Touch UI]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=4775</guid>

					<description><![CDATA[<p>Almost all components require developers to put together the Touch UI experience with tabs as the base of their components. It&#8217;s a simple XML code configuration, however, sometimes finding the reference isn&#8217;t that easy to find online. This article is just a simple reference article where I share the configuration as XML, so it can [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/aem-touch-ui-granite-ui-tabs-example-code">AEM Touch UI (Granite UI) Tabs: Example Code</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Almost all components require developers to put together the Touch UI experience with tabs as the base of their components. It&#8217;s a simple XML code configuration, however, sometimes finding the reference isn&#8217;t that easy to find online. This article is just a simple reference article where I share the configuration as XML, so it can be copied and pasted + ready to go at a rapid pace.</p>
<div class="mention-block">
This code was extracted from Adobe&#8217;s code, the WCM Core Components v2.22.6 Latest; so no surprises.
</div>
<p><a href="#code-snippet">Jump to Code Snippet</a></p>
<hr class="spacer-large"/>
<h3>Granite UI (Touch UI) Rendered as</h3>
<p>This is a screenshot of how a very basic Touch UI would look like for author&#8217;s when the author double clicks on the component to make change&#8217;s to it.<br />
<a href="https://sourcedcode.com/wp-content/uploads/2023/04/example-component-tab-1-tab-2.png"><img loading="lazy" decoding="async" src="https://sourcedcode.com/wp-content/uploads/2023/04/example-component-tab-1-tab-2.png" alt="Touch UI Granite UI Code Configuration Example - Tabs" width="2416" height="1448" class="alignnone size-full wp-image-4777" srcset="https://sourcedcode.com/wp-content/uploads/2023/04/example-component-tab-1-tab-2.png 2416w, https://sourcedcode.com/wp-content/uploads/2023/04/example-component-tab-1-tab-2-300x180.png 300w, https://sourcedcode.com/wp-content/uploads/2023/04/example-component-tab-1-tab-2-1024x614.png 1024w, https://sourcedcode.com/wp-content/uploads/2023/04/example-component-tab-1-tab-2-768x460.png 768w, https://sourcedcode.com/wp-content/uploads/2023/04/example-component-tab-1-tab-2-1536x921.png 1536w, https://sourcedcode.com/wp-content/uploads/2023/04/example-component-tab-1-tab-2-2048x1227.png 2048w, https://sourcedcode.com/wp-content/uploads/2023/04/example-component-tab-1-tab-2-600x360.png 600w" sizes="(max-width: 2416px) 100vw, 2416px" /></a></p>
<p><a href="#code-snippet">Jump to Code Snippet</a></p>
<hr class="spacer-large"/>
<h3 id="code-snippet">Code Snippet</h3>
<p>The solution below includes an example with the &#8220;styletab&#8221; which is an out-of-the-box feature for the AEM Style System. You can copy and paste this snippet into your .content.xml, like _cq_dialog/.content.xml:</p>
<div class="code-1250">
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #339933;">&lt;?</span>xml version<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1.0&quot;</span> encoding<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;UTF-8&quot;</span><span style="color: #339933;">?&gt;</span><br />
<span style="color: #339933;">&lt;</span>jcr<span style="color: #339933;">:</span>root xmlns<span style="color: #339933;">:</span>sling<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://sling.apache.org/jcr/sling/1.0&quot;</span> xmlns<span style="color: #339933;">:</span>granite<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.adobe.com/jcr/granite/1.0&quot;</span> xmlns<span style="color: #339933;">:</span>cq<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.day.com/jcr/cq/1.0&quot;</span> xmlns<span style="color: #339933;">:</span>jcr<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.jcp.org/jcr/1.0&quot;</span> xmlns<span style="color: #339933;">:</span>nt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.jcp.org/jcr/nt/1.0&quot;</span><br />
&nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; jcr<span style="color: #339933;">:</span>title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Example Component&quot;</span><br />
&nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;cq/gui/components/authoring/dialog&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>content<br />
&nbsp; &nbsp; &nbsp; &nbsp; granite<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;cmp-button__editor&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/container&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>items jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>tabs<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/tabs&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; maximized<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{Boolean}true&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>items jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>tab1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Tab 1&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/container&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; margin<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{Boolean}true&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>items jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>columns<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/fixedcolumns&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; margin<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{Boolean}true&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>items jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>column<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/container&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>items jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>exampleinputfield1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/form/textfield&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldDescription<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Example input 1 field can be placed here&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldLabel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Example Input Field 1&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;./exampleinputfield1&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>examplepathfield1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/form/pathfield&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldDescription<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Example path field 1 field can be placed here&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldLabel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Example Path Field 1&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;./examplepathfield1&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rootPath<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/content&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>items<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>column<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>items<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>columns<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>items<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>tab1<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>tab2<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Tab 2&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/container&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; margin<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{Boolean}true&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>items jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>columns<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/fixedcolumns&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; margin<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{Boolean}true&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>items jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>column<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/container&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>items jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>exampleinputfield2<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/form/textfield&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldDescription<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Example input 1 field can be placed here&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldLabel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Example Input Field 2&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;./exampleinputfield2&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>examplepathfield2<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/form/pathfield&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldDescription<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Example path field 2 field can be placed here&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldLabel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Example Path Field 2&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;./examplepathfield2&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rootPath<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/content&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>items<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>column<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>items<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>columns<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>items<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>tab2<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>cq<span style="color: #339933;">:</span>styles<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/include&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; path<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/mnt/overlay/cq/gui/components/authoring/dialog/style/tab_edit/styletab&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>items<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>tabs<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>items<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>content<span style="color: #339933;">&gt;</span><br />
<span style="color: #339933;">&lt;/</span>jcr<span style="color: #339933;">:</span>root<span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div>
</div>
<hr class="spacer-large"/>
<h3>Extras</h3>
<p>If you would like to enable your component for the AEM Style System, click here, <a href="https://sourcedcode.com/blog/aem/how-to-enable-aem-style-system-configuration-for-components">How to Enable AEM Style System Configuration for Components</a>.</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/aem-touch-ui-granite-ui-tabs-example-code">AEM Touch UI (Granite UI) Tabs: Example Code</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/aem-touch-ui-granite-ui-tabs-example-code/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>AEM Touch UI Show Hide Tabs by Style System Configuration</title>
		<link>https://sourcedcode.com/blog/aem/aem-touch-ui-show-hide-tabs-by-style-system-configuration</link>
					<comments>https://sourcedcode.com/blog/aem/aem-touch-ui-show-hide-tabs-by-style-system-configuration#comments</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Sun, 16 Apr 2023 01:10:52 +0000</pubDate>
				<category><![CDATA[AEM]]></category>
		<category><![CDATA[Touch UI]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=4640</guid>

					<description><![CDATA[<p>It&#8217;s no doubt that AEM&#8217;s Style System for Components has become more popular over the past few years, and is used by almost every author in this industry. However, there are some feature flaws in the product for the authoring experience, where sometimes we would like to show or hide Touch UI tabs depending on [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/aem-touch-ui-show-hide-tabs-by-style-system-configuration">AEM Touch UI Show Hide Tabs by Style System Configuration</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>It&#8217;s no doubt that AEM&#8217;s Style System for Components has become more popular over the past few years, and is used by almost every author in this industry. However, there are some feature flaws in the product for the authoring experience, where sometimes we would like to show or hide Touch UI tabs depending on which style system option has been selected for a particular AEM Component.</p>
<p>In this blog article, I have created a solution for this. I have created a custom fix to the issue of hiding or showing Touch UI tabs for a particular component based on which style system has been selected for a given component; so the selected style system controls the hide or show the Touch UI tabs. </p>
<p><strong>How the solution works:</strong><br />
The AEM developer will add code configurations to the cq_dialog.xml which targets one or more tabs with some special properties and nodes like the &#8220;granite:class&#8221; and the &#8220;granite:data&#8221;. After configuring these properties and nodes within the cq_dialog.xml, all tabs will be hidden as the initial rendering phase (during configuration of the component), Upon selection of a Style System, the tabs will be visible based on the matched configuration that is set under the granite:data node properties, based on the StyleSystem CSS class that was set.</p>
<div class="mention-block">
This implementation was tested on Experience Manager 6.5 Service Pack 12 and Experience Manager as a Cloud Service 2022.10.0, but in my opinion, if your AEM environment supports the style system, AEM 6.3 SP1 + Feature Pack 20593, it should be okay.
</div>
<hr class="spacer-larger"/>
<h2 id="the-steps">The Steps</h2>
<p>In this section, I will share with you the steps I have used to make this work as expected. In this section you will be:</p>
<ol>
</li>
<li><a href="#pre-requirements">Pre Requirements.</a></li>
<li><a href="#create-a-new-component-as-example-component">Creating a new component named Example Component.</a></li>
<li><a href="#create-sling-model-for-the-example-component">Creating Sling Model for the  Example Component.</a></li>
<li><a href="#create-the-touch-ui-custom-java-script-implementation">Creating the Touch UI custom JavaScript implementation.</a></li>
<li><a href="#finally-test-it-out">Testing it out.</a></li>
<li><a href="#configuration-explanation-of-the-touch-ui-granite-tab-fields">Configuration Explanation of the Touch UI Granite Tab Fields.</a></li>
</ol>
<hr class="spacer-larger"/>
<h3 id="pre-requirements">0. Pre Requirements</h3>
<p>The creation of this solution to hide or show Touch UI tabs for a particular component based on which style system is selected is based on the best practices of creating AEM components, following the guidelines of the AEM Core Components. This means that when a component is created, it requires a sling model to extends the com.adobe.cq.wcm.core.components.util.AbstractComponentImpl class. In turn the extension of the com.adobe.cq.wcm.core.components.util.AbstractComponentImpl will provide helpers that will expose the appliedCssClassNames property when the component is called with model.json. </p>
<p>Next, the sling model must declare the org.apache.sling.models.annotations.Exporter annotation, so model.json can be called upon for the particular component.</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">path<span style="color: #339933;">:</span> http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//localhost:4502/content/sourcedcode/test/_jcr_content/root/container/container/examplecomponent_536346544.model.json</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #0000ff;">&quot;id&quot;</span><span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;examplecomponent-d4c74a60c1&quot;</span>,<br />
&nbsp; &nbsp;<span style="color: #0000ff;">&quot;dataLayer&quot;</span><span style="color: #339933;">:</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">&quot;examplecomponent-d4c74a60c1&quot;</span><span style="color: #339933;">:</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">&quot;@type&quot;</span><span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;sourcedcode/components/examplecomponent&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">&quot;repo:modifyDate&quot;</span><span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;2023-04-15T23:49:42Z&quot;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp;<span style="color: #009900;">&#125;</span>,<br />
&nbsp; &nbsp;<span style="color: #0000ff;">&quot;:type&quot;</span><span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;sourcedcode/components/examplecomponent&quot;</span>,<br />
&nbsp; &nbsp;<span style="color: #0000ff;">&quot;appliedCssClassNames&quot;</span><span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;show-tab-two-now&quot;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p><a href="#create-sling-model-for-the-example-component">Module B</a> within the article will show you how to setup the sling model to export JSON as mentioned above.</p>
<hr class="spacer-larger"/>
<h2 id="create-a-new-component-as-example-component">A. Create a new component as Example Component</h2>
<p>You will be creating a new component as Example Component where I will install a simple example of the sightly component content&#8217;s a simple Touch UI configuration, and also a simple _cq_design_dialog, so you can actually configure the style system for your given component.</p>
<p>Please note that all files created should be placed under: /ui.apps/src/main/content/jcr_root/apps/sourcedcode/components/examplecomponent</p>
<ol>
<li>Create a new folder /apps/sourcedcode/components/examplecomponent</li>
<li>Create an &#8220;examplecomponent.html&#8221; file under /apps/sourcedcode/components/examplecomponent with the file contents of:
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">Example Component</div></td></tr></tbody></table></div>
</li>
<li>Create a &#8220;.content.xml&#8221; file under /apps/sourcedcode/components/examplecomponent with the file contents of
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">&lt;?xml <span style="color: #000066;">version</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;1.0&quot;</span> encoding<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;UTF-8&quot;</span>?&gt;<br />
&lt;jcr:root xmlns:cq<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.day.com/jcr/cq/1.0&quot;</span> xmlns:jcr<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.jcp.org/jcr/1.0&quot;</span><br />
&nbsp; &nbsp; jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cq:Component&quot;</span><br />
&nbsp; &nbsp; jcr:<span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Example Component&quot;</span><br />
&nbsp; &nbsp; componentGroup<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;SourcedCode - Content&quot;</span><span style="color: #66cc66;">/</span>&gt;</div></td></tr></tbody></table></div>
</li>
<li>Create a &#8220;_cq_editConfig.xml&#8221; file under /apps/sourcedcode/components/examplecomponent with the file contents of
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">&lt;?xml <span style="color: #000066;">version</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;1.0&quot;</span> encoding<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;UTF-8&quot;</span>?&gt;<br />
&lt;jcr:root xmlns:cq<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.day.com/jcr/cq/1.0&quot;</span> xmlns:jcr<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.jcp.org/jcr/1.0&quot;</span><br />
&nbsp; &nbsp; jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cq:EditConfig&quot;</span><span style="color: #66cc66;">/</span>&gt;</div></td></tr></tbody></table></div>
</li>
<li>Create a &#8220;_cq_dialog&#8221; folder under /apps/sourcedcode/components/examplecomponent</li>
<li id="touch-ui-code-configuration">Create a &#8220;.content.xml&#8221; file under /apps/sourcedcode/components/examplecomponent/_cq_dialog with the file contents below.
<p style="padding-top:10px;">We have included custom granite properties to this file in order for this feature to work. If you would like to understand exactly what as added, <a href="#configuration-of-the-touch-ui-granite-tab-fields">please click here to read it in the last section</a>.</p>
<div class="code-1500">
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br />101<br />102<br />103<br />104<br />105<br />106<br />107<br />108<br />109<br />110<br />111<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">&lt;?xml <span style="color: #000066;">version</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;1.0&quot;</span> encoding<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;UTF-8&quot;</span>?&gt;<br />
&lt;jcr:root xmlns:sling<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://sling.apache.org/jcr/sling/1.0&quot;</span> xmlns:granite<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.adobe.com/jcr/granite/1.0&quot;</span> xmlns:cq<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.day.com/jcr/cq/1.0&quot;</span> xmlns:jcr<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.jcp.org/jcr/1.0&quot;</span> xmlns:nt<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.jcp.org/jcr/nt/1.0&quot;</span><br />
&nbsp; &nbsp; jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; jcr:<span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Example Component&quot;</span><br />
&nbsp; &nbsp; sling:resourceType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cq/gui/components/authoring/dialog&quot;</span>&gt;<br />
&nbsp; &nbsp; &lt;<span style="color: #000066;">content</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; sling:resourceType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/container&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;items jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tabs<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling:resourceType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/tabs&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;items jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tab1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr:<span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Tab 1&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling:resourceType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/container&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; margin<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{Boolean}true&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;items jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;columns<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling:resourceType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/fixedcolumns&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; margin<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{Boolean}true&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;items jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;column<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling:resourceType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/container&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;items jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;graniteExample1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling:resourceType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/textfield&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldDescription<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Just an example&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldLabel<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;graniteExample1&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;./graniteExample1&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; required<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{Boolean}false&quot;</span><span style="color: #66cc66;">/</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;<span style="color: #66cc66;">/</span>items&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;<span style="color: #66cc66;">/</span>column&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;<span style="color: #66cc66;">/</span>items&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;<span style="color: #66cc66;">/</span>columns&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;<span style="color: #66cc66;">/</span>items&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;<span style="color: #66cc66;">/</span>tab1&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tab2<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; granite:<span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cq-dialog-stylesystem-tab-showhide&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr:<span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Tab 2&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling:resourceType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/container&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; margin<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{Boolean}true&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;items jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;columns<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling:resourceType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/fixedcolumns&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; margin<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{Boolean}true&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;items jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;column<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling:resourceType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/container&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;items jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;graniteExample2<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling:resourceType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/textfield&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldDescription<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Just an example&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldLabel<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;graniteExample2&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;./graniteExample2&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; required<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{Boolean}false&quot;</span><span style="color: #66cc66;">/</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;<span style="color: #66cc66;">/</span>items&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;<span style="color: #66cc66;">/</span>column&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;<span style="color: #66cc66;">/</span>items&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;<span style="color: #66cc66;">/</span>columns&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;<span style="color: #66cc66;">/</span>items&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;granite:<span style="color: #000066;">data</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; showTabOnAppliedCssClass<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;show-tab-two-now&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tabTitleName<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Tab 2&quot;</span><span style="color: #66cc66;">/</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;<span style="color: #66cc66;">/</span>tab2&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tab3<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr:<span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Tab 3&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling:resourceType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/container&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; margin<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{Boolean}true&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;items jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;columns<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling:resourceType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/fixedcolumns&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; margin<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{Boolean}true&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;items jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;column<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling:resourceType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/container&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;items jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;graniteExample3<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling:resourceType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/textfield&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldDescription<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Just an example&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldLabel<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;graniteExample3&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;./graniteExample3&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; required<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{Boolean}false&quot;</span><span style="color: #66cc66;">/</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;<span style="color: #66cc66;">/</span>items&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;<span style="color: #66cc66;">/</span>column&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;<span style="color: #66cc66;">/</span>items&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;<span style="color: #66cc66;">/</span>columns&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;<span style="color: #66cc66;">/</span>items&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;<span style="color: #66cc66;">/</span>tab3&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;styletab<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling:resourceType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/include&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; path<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/mnt/overlay/cq/gui/components/authoring/dialog/style/tab_edit/styletab&quot;</span><span style="color: #66cc66;">/</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;<span style="color: #66cc66;">/</span>items&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;<span style="color: #66cc66;">/</span>tabs&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;<span style="color: #66cc66;">/</span>items&gt;<br />
&nbsp; &nbsp; &lt;<span style="color: #66cc66;">/</span>content&gt;<br />
&lt;<span style="color: #66cc66;">/</span>jcr:root&gt;</div></td></tr></tbody></table></div>
</div>
</li>
<li>Create a &#8220;_cq_design_dialog&#8221; folder under /apps/sourcedcode/components/examplecomponent</li>
<li>Create a &#8220;.content.xml&#8221; file under /apps/sourcedcode/components/examplecomponent/_cq_design_dialog with the file contents below:
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">&lt;?xml <span style="color: #000066;">version</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;1.0&quot;</span> encoding<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;UTF-8&quot;</span>?&gt;<br />
&lt;jcr:root xmlns:sling<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://sling.apache.org/jcr/sling/1.0&quot;</span> xmlns:granite<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.adobe.com/jcr/granite/1.0&quot;</span> xmlns:cq<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.day.com/jcr/cq/1.0&quot;</span> xmlns:jcr<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.jcp.org/jcr/1.0&quot;</span> xmlns:nt<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.jcp.org/jcr/nt/1.0&quot;</span><br />
&nbsp; &nbsp; jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; jcr:<span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Example Component&quot;</span><br />
&nbsp; &nbsp; sling:resourceType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cq/gui/components/authoring/dialog&quot;</span>&gt;<br />
&nbsp; &nbsp; &lt;<span style="color: #000066;">content</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; sling:resourceType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/container&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;items jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tabs<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling:resourceType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/tabs&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; maximized<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{Boolean}true&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;items jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;styletab<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr:primaryType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling:resourceType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/include&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; path<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/mnt/overlay/cq/gui/components/authoring/dialog/style/tab_design/styletab&quot;</span><span style="color: #66cc66;">/</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;<span style="color: #66cc66;">/</span>items&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;<span style="color: #66cc66;">/</span>tabs&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;<span style="color: #66cc66;">/</span>items&gt;<br />
&nbsp; &nbsp; &lt;<span style="color: #66cc66;">/</span>content&gt;<br />
&lt;<span style="color: #66cc66;">/</span>jcr:root&gt;</div></td></tr></tbody></table></div>
</li>
<li>You are now done with the creation of the example component.</li>
</ol>
<hr class="spacer-larger"/>
<h2 id="create-sling-model-for-the-example-component">B. Create Sling Model for the  Example Component</h2>
<p>This is a very simple implementation for a sling model for the Example Component. The reason why we need to setup the Sling Model backend for our component because we need to obtain the &#8220;appliedCssClassNames&#8221; property from the configured component, which is configured by the content authors. If you have not already, please take a look at the <a href="#pre-requirements">pre-requirements</a> section of this website, where calling the model.json of this particular component should expose the &#8220;appliedCssClassNames&#8221; which is vital for this solution to work. Implementing com.adobe.cq.wcm.core.components.util.AbstractComponentImpl is a best practice of the WCM Core Components where it promotes new features like the data-layer, and should be apart of your development tool kit when developing more modern AEM components. </p>
<p>Next, the sling model must declare the org.apache.sling.models.annotations.Exporter annotation, so model.json can be called upon for the particular component; like http://localhost:4502/content/sourcedcode/test/_jcr_content/root/container/container/examplecomponent_536346544.model.json.</p>
<p>Being able to resolve .model.json is vital for the hide or show Touch UI tabs for a particular component based on which style system is selected to work.</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.sourcedcode.core.internal.models</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.adobe.cq.export.json.ExporterConstants</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.adobe.cq.wcm.core.components.util.AbstractComponentImpl</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.sling.api.SlingHttpServletRequest</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.sling.models.annotations.DefaultInjectionStrategy</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.sling.models.annotations.Exporter</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.sling.models.annotations.Model</span><span style="color: #339933;">;</span><br />
<br />
@Model<span style="color: #009900;">&#40;</span>adaptables <span style="color: #339933;">=</span> SlingHttpServletRequest.<span style="color: #000000; font-weight: bold;">class</span>, resourceType <span style="color: #339933;">=</span> ExampleComponentImpl.<span style="color: #006633;">RESOURCE_TYPE</span>, defaultInjectionStrategy <span style="color: #339933;">=</span> DefaultInjectionStrategy.<span style="color: #006633;">OPTIONAL</span><span style="color: #009900;">&#41;</span><br />
@Exporter<span style="color: #009900;">&#40;</span>name <span style="color: #339933;">=</span> ExporterConstants.<span style="color: #006633;">SLING_MODEL_EXPORTER_NAME</span>, extensions <span style="color: #339933;">=</span> ExporterConstants.<span style="color: #006633;">SLING_MODEL_EXTENSION</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ExampleComponentImpl <span style="color: #000000; font-weight: bold;">extends</span> AbstractComponentImpl <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> RESOURCE_TYPE <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;sourcedcode/components/examplecomponent&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<hr class="spacer-larger"/>
<h3 id="create-the-touch-ui-custom-java-script-implementation">C. Create the Touch UI custom JavaScript implementation</h3>
<p>You will be creating a clientlib-author Client Library which will be executed inthe editor.html authoring page. The Javascript should be executed upon opening up a Touch UI dialog.</p>
<p>Please note that all files created should be placed under: /ui.apps/src/main/content/jcr_root/apps/sourcedcode/clientlibs/clientlib-author</p>
<ol>
<li>Create the &#8220;clientlib-author&#8221; folder under /ui.apps/src/main/content/jcr_root/apps/sourcedcode/clientlibs</li>
<li>Create a &#8220;.content.xml&#8221; file under /ui.apps/src/main/content/jcr_root/apps/sourcedcode/clientlibs with the file contents of:
<div class="mention-block">
To understand how to add a Custom Client Library for AEM Author Editor Touch UI, <a href="https://sourcedcode.com/blog/aem/adding-custom-client-library-for-aem-author-editor-touch-ui" rel="noopener" target="_blank">click here</a>.
</div>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #339933;">&lt;?</span>xml version<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1.0&quot;</span> encoding<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;UTF-8&quot;</span><span style="color: #339933;">?&gt;</span><br />
<span style="color: #339933;">&lt;</span>jcr<span style="color: #339933;">:</span>root xmlns<span style="color: #339933;">:</span>cq<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.day.com/jcr/cq/1.0&quot;</span> xmlns<span style="color: #339933;">:</span>jcr<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.jcp.org/jcr/1.0&quot;</span><br />
&nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;cq:ClientLibraryFolder&quot;</span><br />
&nbsp; &nbsp; categories<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;[cq.authoring.editor.sites.page.hook]&quot;</span><br />
&nbsp; &nbsp; dependencies<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;[cq.authoring.editor.sites.page]&quot;</span><span style="color: #339933;">/&gt;</span></div></td></tr></tbody></table></div>
</li>
<li>Create the &#8220;js&#8221; folder under /ui.apps/src/main/content/jcr_root/apps/sourcedcode/clientlibs/clientlib-author</li>
<li>Create a file named &#8220;stylesystem-tab-showhide.js&#8221; with the contents inside:
<div class="code-750">
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #008000; font-style: italic; font-weight: bold;">/** &nbsp; &nbsp;<br />
* Author: Brian Kasing Li @ https://www.linkedin.com/in/briankasingli &nbsp; &nbsp;<br />
* Documentation: https://sourcedcode.com/blog/aem/aem-touch-ui-show-hide-tabs-by-style-system-configurgation&nbsp; &nbsp; &nbsp;<br />
**/</span><br />
<br />
<span style="color: #009900;">&#40;</span>function <span style="color: #009900;">&#40;</span>document, $<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">&quot;use strict&quot;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; var <span style="color: #000000; font-weight: bold;">CONST</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; TARGET_GRANITE_CLASS<span style="color: #339933;">:</span> <span style="color: #0000ff;">'.cq-dialog-stylesystem-tab-showhide'</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; GRANITE_DATA_PROP_TAB_TITLE_NAME<span style="color: #339933;">:</span> <span style="color: #0000ff;">'tabtitlename'</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; GRANITE_DATA_PROP_SHOW_TAB_ON_APPLIED_CSS_CLASS<span style="color: #339933;">:</span> <span style="color: #0000ff;">'showtabonappliedcssclass'</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; APPLIED_CSS_CLASS_NAMES<span style="color: #339933;">:</span> <span style="color: #0000ff;">'appliedCssClassNames'</span>,<br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
&nbsp; &nbsp; &nbsp;* foundation-contentloaded<br />
&nbsp; &nbsp; &nbsp;* adding event listener to the Touch UI popup, so when the Touch UI is envoked, the code in will be executed.<br />
&nbsp; &nbsp; &nbsp;* - initially, any TouchUI tabs which includes granite:class=&quot;cq-dialog-stylesystem-tab-showhide&quot; will be hidden.<br />
&nbsp; &nbsp; &nbsp;* - upon response from the .model.json ajax request, we will showTabs based on what's configured for &quot;tabtitlename&quot; and &quot;showTabOnAppliedCssClass&quot;.<br />
&nbsp; &nbsp; &nbsp;* <br />
&nbsp; &nbsp; &nbsp;* @returns void<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">on</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;foundation-contentloaded&quot;</span>, function <span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span>e.<span style="color: #006633;">target</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">prop</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tagName'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #0000ff;">'CORAL-DIALOG'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hideTabs<span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span>e.<span style="color: #006633;">target</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var url <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>e.<span style="color: #006633;">target</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">find</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'.cq-dialog'</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'action'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;.model.json&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $.<span style="color: #006633;">getJSON</span><span style="color: #009900;">&#40;</span>url, function<span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#91;</span><span style="color: #000000; font-weight: bold;">CONST</span>.<span style="color: #006633;">APPLIED_CSS_CLASS_NAMES</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; showTabs<span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span>e.<span style="color: #006633;">target</span><span style="color: #009900;">&#41;</span>, data<span style="color: #009900;">&#91;</span><span style="color: #000000; font-weight: bold;">CONST</span>.<span style="color: #006633;">APPLIED_CSS_CLASS_NAMES</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
&nbsp; &nbsp; &nbsp;* this finds all Touch UI fields with the cssClass .cq-dialog-stylesystem-tab-showhide, which should be found as an attribute<br />
&nbsp; &nbsp; &nbsp;* under sling:resourceType=&quot;granite/ui/components/coral/foundation/container&quot;, which &quot;hides&quot; all tab options from the authors.<br />
&nbsp; &nbsp; &nbsp;* @returns void<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; function hideTabs<span style="color: #009900;">&#40;</span>$parentEle<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $parentEle.<span style="color: #006633;">find</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">CONST</span>.<span style="color: #006633;">TARGET_GRANITE_CLASS</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">each</span><span style="color: #009900;">&#40;</span>function<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var $this <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var tabtitlename <span style="color: #339933;">=</span> $this.<span style="color: #006633;">data</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">CONST</span>.<span style="color: #006633;">GRANITE_DATA_PROP_TAB_TITLE_NAME</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'._coral-Tabs-itemLabel'</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">each</span><span style="color: #009900;">&#40;</span>function<span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">html</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> tabtitlename<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">closest</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'coral-tab'</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
&nbsp; &nbsp; &nbsp;* after a successful response of the .model.json ajax request, <br />
&nbsp; &nbsp; &nbsp;* this finds all Touch UI fields with the cssClass .cq-dialog-stylesystem-tab-showhide, which should be found as an attribute<br />
&nbsp; &nbsp; &nbsp;* under sling:resourceType=&quot;granite/ui/components/coral/foundation/container&quot;. Based on the set properties of<br />
&nbsp; &nbsp; &nbsp;* granite:data values set for &quot;tabtitlename&quot; and &quot;showTabOnAppliedCssClass&quot;, the matched tabs will be &quot;visible&quot; from the authors.<br />
&nbsp; &nbsp; &nbsp;* <br />
&nbsp; &nbsp; &nbsp;* @returns void<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; function showTabs<span style="color: #009900;">&#40;</span>$parentEle, appliedCssClassNames<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $parentEle.<span style="color: #006633;">find</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">CONST</span>.<span style="color: #006633;">TARGET_GRANITE_CLASS</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">each</span><span style="color: #009900;">&#40;</span>function<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var $this <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var tabtitlename <span style="color: #339933;">=</span> $this.<span style="color: #006633;">data</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">CONST</span>.<span style="color: #006633;">GRANITE_DATA_PROP_TAB_TITLE_NAME</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var targetappliedcssclass <span style="color: #339933;">=</span> $this.<span style="color: #006633;">data</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">CONST</span>.<span style="color: #006633;">GRANITE_DATA_PROP_SHOW_TAB_ON_APPLIED_CSS_CLASS</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #0000ff;">'INVALID_APPLIED_CSS_CLASS'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>appliedCssClassNames.<span style="color: #006633;">split</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">includes</span><span style="color: #009900;">&#40;</span>targetappliedcssclass<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'._coral-Tabs-itemLabel'</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">each</span><span style="color: #009900;">&#40;</span>function<span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">html</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> tabtitlename<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">closest</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'coral-tab'</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>document, Granite.$<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
</div>
</li>
<li>Create a &#8220;js.txt&#8221; file under /ui.apps/src/main/content/jcr_root/apps/sourcedcode/clientlibs with the file contents of:
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">#base<span style="color: #339933;">=</span>js<br />
stylesystem<span style="color: #339933;">-</span>tab<span style="color: #339933;">-</span>showhide.<span style="color: #006633;">js</span></div></td></tr></tbody></table></div>
</li>
<li>You are now finished creating the clientlib-author client library.</li>
</ol>
<hr class="spacer-larger"/>
<h3 id="finally-test-it-out">D. Finally, test it out.</h3>
<ol>
<li>Edit the component policies within the editable template, to include a style system class of &#8220;show-tab-two-now&#8221;</li>
<li>Edit a page of your choice, and drag the Example Component into the page</li>
<li>Configure the component to add style system &#8220;show-tab-two-now&#8221; for the given component</li>
<li>Note: if &#8220;show-tab-two-now&#8221; is not an option as a Style System for your current component, then you must add some policies for your component.</li>
<li>Now you should see Tab 2 visible.</li>
<li>Done</li>
</ol>
<hr class="spacer-larger"/>
<h3 id="configuration-explanation-of-the-touch-ui-granite-tab-fields">E. Configuration Explanation of the Touch UI Granite Tab Fields</h3>
<p>After the installation of the client library custom code, you should be able to start adding properties to your Touch UI code, for this feature, like the screenshot below:<br />
<a href="https://sourcedcode.com/wp-content/uploads/2023/04/touch-ui-tabs-configuration-in-code-lines-detail.png"><img decoding="async" src="https://sourcedcode.com/wp-content/uploads/2023/04/touch-ui-tabs-configuration-in-code-lines-detail.png" alt="Touch UI Granite UI Code Configuration Example" width="100%" class="size-full wp-image-4659" /></a> </p>
<p>Indicating in the screenshot above, you have realized that we are introducing <span class="code-highlight-primary">granite:class=&#8221;cq-dialog-stylesystem-tab-showhide&#8221;</span>line:43 which will be placed at the root level of the tab XML structure; when this property is placed, when author initially call the TouchUI popup, all tabs with this granite:class will be hidden. Inside of the tab XML structure, we introduced a new node configuration, line:70,as <span class="code-highlight-primary">granite:data</span>, which introduced two new properties.</p>
<p>The <span class="code-highlight-primary">granite:data</span> has two properties that will determine which tab to show, and also which option of style system has been configured, so we can show the tab as expected.</p>
<p><strong>Note:</strong>, since we are using the granite <span class="code-highlight-secondary">namespace</span>, you need to ensure your XML declaration for the Touch UI includes: <span class="code-highlight-secondary">xmlns:granite=&#8221;http://www.adobe.com/jcr/granite/1.0&#8243;</span>. You can see this example from the <a href="#touch-ui-code-configuration">Touch UI code configuration that we have installed</a> line:2 in our code examples.</p>
<p><strong>properties:</strong></p>
<ul>
<li><strong>tabTitleName</strong>: the exact name of the tab (jcr:title). Taking a look at the screenshot above line:73 this property matches exactly what is under line:43, the jcr:title.</li>
<li><strong>showTabOnAppliedCssClass</strong>: this is the CSS class name that has been configured by the content authors via AEM&#8217;s style system; this field must match exactly to the style system CSS class that has been configured by the component policies. The CSS class set here is the target&#8217;s the Style System CSS class name that should make the table visible when matched.</li>
</ul>
<hr class="spacer-larger"/>
<h3>Summary</h3>
<p>Please understand that even if the tabs are hidden from the Touch UI, the existing properties that are already content authored without this feature will not be removed as expected, and Sightly may continue to render content on the page; this means that&#8230; if for example, I have the style system enable or disable the Touch UI checkbox to &#8220;open new tab&#8221;. if this field was already content authored&#8230; and this custom code hide&#8217;s the field&#8230; since the already configured component&#8217;s property is still persisted, your Sightly may be still opening the button in a new tab.</p>
<p>To ensure that if a style system is enabled, and you do not want Sightly to render some items on the page, you will need to make some changes to the code itself.  </p>
<div class="mention-block">
To learn how to obtain the style system AEM component configuration In the backend code, take a look at this blog, <a href="https://sourcedcode.com/blog/aem/aem-style-system-component-information-with-code-sling-models" rel="noopener" target="_blank">AEM Style System Component Information with Code Sling Models</a>.
</div>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/aem-touch-ui-show-hide-tabs-by-style-system-configuration">AEM Touch UI Show Hide Tabs by Style System Configuration</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/aem-touch-ui-show-hide-tabs-by-style-system-configuration/feed</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>What are AEM ExtraClientlibs?</title>
		<link>https://sourcedcode.com/blog/aem/what-are-aem-extraclientlibs</link>
					<comments>https://sourcedcode.com/blog/aem/what-are-aem-extraclientlibs#respond</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Tue, 20 Sep 2022 04:51:05 +0000</pubDate>
				<category><![CDATA[AEM]]></category>
		<category><![CDATA[Client Libraries]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Touch UI]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=3796</guid>

					<description><![CDATA[<p>When dealing with cq:ClientLibraryFolder (node type), you may have come across a property called extraClientlibs. What are extraClientlibs and how does it work? As you may recall, when you want to add custom functionality or styling to the Touch Dialogues (in edit author mode, editor.html), we must include cq.authoring.editor.sites.page as a dependency and cq.authoring.editor.sites.page.hook as [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/what-are-aem-extraclientlibs">What are AEM ExtraClientlibs?</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>When dealing with cq:ClientLibraryFolder (node type), you may have come across a property called extraClientlibs. What are extraClientlibs and how does it work?</p>
<p>As you may recall, when you want to add custom functionality or styling to the Touch Dialogues (in edit author mode, editor.html), we must include cq.authoring.editor.sites.page as a dependency and cq.authoring.editor.sites.page.hook as a category to our client library&#8217;s configuration. The configuration would look something like this:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<span style="color: #000000; font-weight: bold;">&lt;jcr:root</span> <span style="color: #000066;">xmlns:cq</span>=<span style="color: #ff0000;">&quot;http://www.day.com/jcr/cq/1.0&quot;</span> <span style="color: #000066;">xmlns:jcr</span>=<span style="color: #ff0000;">&quot;http://www.jcp.org/jcr/1.0&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;cq:ClientLibraryFolder&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">dependencies</span>=<span style="color: #ff0000;">&quot;[cq.authoring.editor.sites.page]&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">categories</span>=<span style="color: #ff0000;">&quot;[cq.authoring.editor.sites.page.hook]&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></div></td></tr></tbody></table></div>
<p><a href="https://sourcedcode.com/wp-content/uploads/2022/09/cq.authoring.editor.sites_.page_.click_.png"><img decoding="async" src="https://sourcedcode.com/wp-content/uploads/2022/09/cq.authoring.editor.sites_.page_.click_.png" alt="Diagram of how the ccq.authoring.editor.sites will be triggered." width="100%" class="alignnone size-full wp-image-3801" srcset="https://sourcedcode.com/wp-content/uploads/2022/09/cq.authoring.editor.sites_.page_.click_.png 1638w, https://sourcedcode.com/wp-content/uploads/2022/09/cq.authoring.editor.sites_.page_.click_-300x116.png 300w, https://sourcedcode.com/wp-content/uploads/2022/09/cq.authoring.editor.sites_.page_.click_-1024x395.png 1024w, https://sourcedcode.com/wp-content/uploads/2022/09/cq.authoring.editor.sites_.page_.click_-768x296.png 768w, https://sourcedcode.com/wp-content/uploads/2022/09/cq.authoring.editor.sites_.page_.click_-1536x593.png 1536w, https://sourcedcode.com/wp-content/uploads/2022/09/cq.authoring.editor.sites_.page_.click_-600x232.png 600w" sizes="(max-width: 1638px) 100vw, 1638px" /></a></p>
<p>This configuration above will evoke the client library every time the Touch UI dialogue is triggered, for all components. Illustrated above, from the author (editor.html), clicking on any component throughout the entire AEM platform, will invoke the client library.</p>
<p><strong>Benefits of using cq.authoring.editor.sites.page:</strong></p>
<ol>
<li>Client libraries created like this will be invoked for all components (when the Touch UI is open)</li>
</ol>
<hr class="spacer-large" />
<p><strong>But however, what happens if you only want your custom functionality or styling to be only called by ONE component? Well, we use the extraClientlibs property from the component&#8217;s Touch UI dialogue.</strong></p>
<p><a href="https://sourcedcode.com/wp-content/uploads/2022/09/my.example.clientlib.calls_.png"><img decoding="async" src="https://sourcedcode.com/wp-content/uploads/2022/09/my.example.clientlib.calls_.png" alt="Diagram of how the extraClientlibs will be triggered." width="100%" height="451" class="alignnone size-full wp-image-3803" srcset="https://sourcedcode.com/wp-content/uploads/2022/09/my.example.clientlib.calls_.png 1452w, https://sourcedcode.com/wp-content/uploads/2022/09/my.example.clientlib.calls_-300x93.png 300w, https://sourcedcode.com/wp-content/uploads/2022/09/my.example.clientlib.calls_-1024x318.png 1024w, https://sourcedcode.com/wp-content/uploads/2022/09/my.example.clientlib.calls_-768x239.png 768w, https://sourcedcode.com/wp-content/uploads/2022/09/my.example.clientlib.calls_-600x186.png 600w" sizes="(max-width: 1452px) 100vw, 1452px" /></a></p>
<p>Illustrated above, you will notice that adding String[] extraClientlibs to the cq:dialog (root node) of the component, the client library will only be invoked, only targeting the Touch UI dialogue that is associated to a specific component.</p>
<p><strong>Benefits of using extraClientlibs:</strong></p>
<ol>
<li>Touch UI will only invoke the targeted client library that is configured.</li>
<li>Client libraries can be created to be specifically used for a particular component.</li>
</ol>
<p><strong>Example of usage of extraClientlibs in line:6</strong></p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<span style="color: #000000; font-weight: bold;">&lt;jcr:root</span> <span style="color: #000066;">xmlns:sling</span>=<span style="color: #ff0000;">&quot;http://sling.apache.org/jcr/sling/1.0&quot;</span> <span style="color: #000066;">xmlns:granite</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/jcr/granite/1.0&quot;</span> <span style="color: #000066;">xmlns:cq</span>=<span style="color: #ff0000;">&quot;http://www.day.com/jcr/cq/1.0&quot;</span> <span style="color: #000066;">xmlns:jcr</span>=<span style="color: #ff0000;">&quot;http://www.jcp.org/jcr/1.0&quot;</span> <span style="color: #000066;">xmlns:nt</span>=<span style="color: #ff0000;">&quot;http://www.jcp.org/jcr/nt/1.0&quot;</span><br />
&nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; <span style="color: #000066;">jcr:title</span>=<span style="color: #ff0000;">&quot;Component's Granite UI&quot;</span><br />
&nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;cq/gui/components/authoring/dialog&quot;</span><br />
&nbsp; <span style="color: #000066;">extraClientlibs</span>=<span style="color: #ff0000;">&quot;[my.custom.clientlib]&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">&lt;content</span><br />
&nbsp; &nbsp; <span style="color: #000066;">granite:class</span>=<span style="color: #ff0000;">&quot;cmp-teaser__editor cmp-image__editor&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/container&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;items</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;tabs</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/tabs&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;items</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;layout</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:title</span>=<span style="color: #ff0000;">&quot;Layout&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/container&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">margin</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">sling:orderBefore</span>=<span style="color: #ff0000;">&quot;actions&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;items</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;columns</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/fixedcolumns&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">margin</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;items</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;column</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/container&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;items</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;layout</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/select&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;Layout&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./layout&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
...</div></td></tr></tbody></table></div>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/what-are-aem-extraclientlibs">What are AEM ExtraClientlibs?</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/what-are-aem-extraclientlibs/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>AEM Granite UI Coral 3 Number Field Default Value</title>
		<link>https://sourcedcode.com/blog/aem/aem-granite-ui-coral-3-number-field-default-value</link>
					<comments>https://sourcedcode.com/blog/aem/aem-granite-ui-coral-3-number-field-default-value#comments</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Wed, 07 Sep 2022 03:17:53 +0000</pubDate>
				<category><![CDATA[AEM]]></category>
		<category><![CDATA[Touch UI]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=3651</guid>

					<description><![CDATA[<p>This article is for how can we set the default positive or negative integer value for the Granite UI 1.0 Coral 3 numberfield, granite/ui/components/coral/foundation/form/numberfield. Apparently the Granite UI 1.0 documentation for the granite/ui/components/coral/foundation/form/numberfield, does not support default value configuration for the numberfield. Keep reading&#8230; I mean, they do&#8230; you can set a default value for [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/aem-granite-ui-coral-3-number-field-default-value">AEM Granite UI Coral 3 Number Field Default Value</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This article is for how can we set the <strong>default</strong> positive or negative integer value for the Granite UI 1.0 Coral 3 numberfield, granite/ui/components/coral/foundation/form/numberfield.</p>
<p>Apparently the Granite UI 1.0 <a href="https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/components/foundation/form/numberfield/index.html" rel="noopener" target="_blank">documentation for the <strong>granite/ui/components/coral/foundation/form/numberfield</strong></a>, does not support default value configuration for the numberfield. Keep reading&#8230;</p>
<p>I mean, they do&#8230; you can set a default value for the <strong>granite/ui/components/coral/foundation/form/numberfield</strong> by setting the <strong>value</strong> property with a positive or negative integer; this works well when a new component is dragged into your editable page, but components that are already exist in the authored page will not be able to set this default value.</p>
<hr class="spacer-medium" />
<p><strong>This is an example of the Touch UI XML configuration, set with the value of 100; this works well when a new component is dragged into your editable page, <span style="color: red;">but components that are already exist in the authored page will not be able to set this default value</span>. This is a problem for existing components because this configuration will set the value to BLANK, when the component is being saved.</p>
<p>Follow this blog below to solve this problem.</strong><br />
<em>Here you can see line:9 it has a value set to 100.</em></p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;numberfieldExample</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/numberfield&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">allowDecimals</span>=<span style="color: #ff0000;">&quot;false&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">allowNegative</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;Number Field&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./numberfieldExample&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">required</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;100&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/numberfieldExample<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p><a class="foobox fbx-instance fbx-link" href="https://sourcedcode.com/wp-content/uploads/2022/09/number-field-showing-as-blank.png"><img decoding="async" src="https://sourcedcode.com/wp-content/uploads/2022/09/number-field-showing-as-blank.png" width="300px" alt="Example of existing components not able to make visible, the value property (default value); however, for all new components that are dragged on the page, the default value is set accordingly."/></a><br />
<em>Example of existing components not able to make visible, the value property (default value); however, for all new components that are dragged on the page, the default value is set accordingly.</em></p>
<hr class="spacer-larger" />
<h2>Solving this problem with Custom Code</h2>
<p>We can solve this problem by introducing a new client library to the author&#8217;s editor.html. The client library should have dependencies=&#8221;[cq.authoring.editor.sites.page] and categories=&#8221;[cq.authoring.editor.sites.page.hook]. </p>
<p>What is actually happening in the code below is that it tries to find all coral3-NumberInput, input fields, from the Touch UI popup. And then, for each input field element, wether if the element is empty and has a non-empty data-default value (HTML data attribute). When this condition is met, the empty input field will set the defaultValue. If a value exists for the input field element, it will be left alone.</p>
<p><strong>The code is very simple, take a look at the implementation below:</strong><br />
<strong>Custom JavaScript to the editor.html</strong></p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>document<span style="color: #339933;">,</span> $<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #3366CC;">&quot;use strict&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// trigger function after foundation-contentloaded</span><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">on</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;foundation-contentloaded&quot;</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// find all coral3-NumberInput from the Touch UI popup from the editor.html</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; setDefaultValue<span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.coral3-NumberInput&quot;</span><span style="color: #339933;">,</span> e.<span style="color: #660066;">target</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">function</span> setDefaultValue<span style="color: #009900;">&#40;</span>el<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; el.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">,</span> element<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> $el <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$el.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> fieldVal <span style="color: #339933;">=</span> $el.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> defaultVal <span style="color: #339933;">=</span> $el.<span style="color: #660066;">data</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'defaultvalue'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>fieldVal <span style="color: #339933;">&amp;&amp;</span> defaultVal<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $el.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span>defaultVal<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>document<span style="color: #339933;">,</span> Granite.$<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<div class="mention-block">
<strong>AEMaaCS Changes:</strong><br />
I realized AEMaaCS uses difference CSS classes when the granite/ui/components/coral/foundation/form/numberfield is rendered on the touch UI, and the Javascript above needs to be improved. Please try to use the JS below to get it working as expected, when working with AEMaaCS. line:6 is the change where we are targeting the coral-numberinput element instead.</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>document<span style="color: #339933;">,</span> $<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #3366CC;">&quot;use strict&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// trigger function after foundation-contentloaded</span><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">on</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;foundation-contentloaded&quot;</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// find all &lt;coral-numberinput&gt; from the Touch UI popup from the editor.html</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; setDefaultValue<span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;coral-numberinput&quot;</span><span style="color: #339933;">,</span> e.<span style="color: #660066;">target</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">function</span> setDefaultValue<span style="color: #009900;">&#40;</span>el<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; el.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">,</span> element<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> $el <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$el.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> fieldVal <span style="color: #339933;">=</span> $el.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> defaultVal <span style="color: #339933;">=</span> $el.<span style="color: #660066;">data</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'defaultvalue'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>fieldVal <span style="color: #339933;">&amp;&amp;</span> defaultVal<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $el.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span>defaultVal<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>document<span style="color: #339933;">,</span> Granite.$<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
</div>
<p><strong>XML Touch UI configuration</strong><br />
Please notice the granite:data field that has been added from line 9-11. The custom JavaScript will read the defaultValue property from this block of code, and will use it to configure the default integer for this field.</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;numberfieldExample</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/numberfield&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">allowDecimals</span>=<span style="color: #ff0000;">&quot;false&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">allowNegative</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;Number Field&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./numberfieldExample&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">required</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;granite:data</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">defaultValue</span>=<span style="color: #ff0000;">&quot;100&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/numberfieldExample<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p><a class="foobox fbx-instance fbx-link" href="https://sourcedcode.com/wp-content/uploads/2022/09/number-field-showing-as-default-working.png"><img decoding="async" src="https://sourcedcode.com/wp-content/uploads/2022/09/number-field-showing-as-default-working.png" alt="Example of existing components now able to set the default value accordingly." width="300px" class="alignnone size-full wp-image-3685" /></a><br />
<em>Example of existing components now able to set the default value accordingly.</em></p>
<hr class="spacer-larger" />
<h2>Installing the Custom Code to the Editor.html</h2>
<div class="mention-block">If you would like to skip all the steps below, download the entire client library example, <a href="https://sourcedcode.com/wp-content/uploads/2022/09/clientlib-authoring-numberfield-example.zip" rel="noopener" target="_blank">click here</a> (please understand that this code is not deployable to AEM).</div>
<p></p>
<p><strong>Step 1.</strong><br />
Create a new folder in your project like<br />
path: /apps/sourcedcode/clientlibs/clientlib-authoring-numberfield-example</p>
<p><strong>Step 2.</strong><br />
Create an .content.xml file right under the folder with contents like:<br />
path: /apps/sourcedcode/clientlibs/clientlib-authoring-numberfield-example/.content.xml</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<span style="color: #000000; font-weight: bold;">&lt;jcr:root</span> <span style="color: #000066;">xmlns:cq</span>=<span style="color: #ff0000;">&quot;http://www.day.com/jcr/cq/1.0&quot;</span> <span style="color: #000066;">xmlns:jcr</span>=<span style="color: #ff0000;">&quot;http://www.jcp.org/jcr/1.0&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;cq:ClientLibraryFolder&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">dependencies</span>=<span style="color: #ff0000;">&quot;[cq.authoring.editor.sites.page]&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">categories</span>=<span style="color: #ff0000;">&quot;[cq.authoring.editor.sites.page.hook]&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></div></td></tr></tbody></table></div>
<p><strong>Step 3.</strong><br />
Create an empty css.txt file right under the folder like:<br />
path: /apps/sourcedcode/clientlibs/clientlib-authoring-numberfield-example/css.txt</p>
<p><strong>Step 4.</strong><br />
Create a js.txt file right under the folder like below with the contents:<br />
path: /apps/sourcedcode/clientlibs/clientlib-authoring-numberfield-example/js.txt</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">#<span style="color: #000066;">base</span>=js<br />
granite-ui-numberfield-default-value.js</div></td></tr></tbody></table></div>
<hr class="spacer-large"/>
<div class="mention-block">If you would like to skip all the steps below, download the entire client library example, <a href="https://sourcedcode.com/wp-content/uploads/2022/09/clientlib-authoring-numberfield-example.zip" rel="noopener" target="_blank">click here</a> (please understand that this code is not deployable to AEM).</div>
<hr class="spacer-large"/>
<p><strong>Step 5.</strong><br />
Create an empty js folder under that folder that just have been created like:<br />
path: /apps/sourcedcode/clientlibs/clientlib-authoring-numberfield-example/js</p>
<p><strong>Step 6.</strong><br />
Create a JavaScript file within the js folder with the contents:<br />
path: /apps/sourcedcode/clientlibs/clientlib-authoring-numberfield-example/js/granite-ui-numberfield-default-value.js</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>document<span style="color: #339933;">,</span> $<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #3366CC;">&quot;use strict&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// trigger function after foundation-contentloaded</span><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">on</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;foundation-contentloaded&quot;</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// find all coral3-NumberInput from the Touch UI popup from the editor.html</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; setDefaultValue<span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.coral3-NumberInput&quot;</span><span style="color: #339933;">,</span> e.<span style="color: #660066;">target</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">function</span> setDefaultValue<span style="color: #009900;">&#40;</span>el<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; el.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">,</span> element<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> $el <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$el.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> fieldVal <span style="color: #339933;">=</span> $el.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> defaultVal <span style="color: #339933;">=</span> $el.<span style="color: #660066;">data</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'defaultvalue'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>fieldVal <span style="color: #339933;">&amp;&amp;</span> defaultVal<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $el.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span>defaultVal<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>document<span style="color: #339933;">,</span> Granite.$<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<div class="mention-block">
<strong>AEMaaCS Changes:</strong><br />
I realized AEMaaCS uses difference CSS classes when the granite/ui/components/coral/foundation/form/numberfield is rendered on the touch UI, and the Javascript above needs to be improved. Please try to use the JS below to get it working as expected, when working with AEMaaCS. line:6 is the change where we are targeting the coral-numberinput element instead.</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>document<span style="color: #339933;">,</span> $<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #3366CC;">&quot;use strict&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// trigger function after foundation-contentloaded</span><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">on</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;foundation-contentloaded&quot;</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// find all &lt;coral-numberinput&gt; from the Touch UI popup from the editor.html</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; setDefaultValue<span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;coral-numberinput&quot;</span><span style="color: #339933;">,</span> e.<span style="color: #660066;">target</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">function</span> setDefaultValue<span style="color: #009900;">&#40;</span>el<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; el.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">,</span> element<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> $el <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$el.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> fieldVal <span style="color: #339933;">=</span> $el.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> defaultVal <span style="color: #339933;">=</span> $el.<span style="color: #660066;">data</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'defaultvalue'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>fieldVal <span style="color: #339933;">&amp;&amp;</span> defaultVal<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $el.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span>defaultVal<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>document<span style="color: #339933;">,</span> Granite.$<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
</div>
<p><strong>Step 7.</strong><br />
Use your maven skills to push the code into AEM. </p>
<div class="mention-block">If you would like to download the entire client library example, <a href="https://sourcedcode.com/wp-content/uploads/2022/09/clientlib-authoring-numberfield-example.zip" rel="noopener" target="_blank">click here</a> (please understand that this code is not deployable to AEM).</div>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/aem-granite-ui-coral-3-number-field-default-value">AEM Granite UI Coral 3 Number Field Default Value</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/aem-granite-ui-coral-3-number-field-default-value/feed</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>AEM Granite UI Multifield Maximum Items Validation</title>
		<link>https://sourcedcode.com/blog/aem/aem-granite-ui-multifield-maximum-items-validation</link>
					<comments>https://sourcedcode.com/blog/aem/aem-granite-ui-multifield-maximum-items-validation#comments</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Sat, 16 Jul 2022 22:34:04 +0000</pubDate>
				<category><![CDATA[AEM]]></category>
		<category><![CDATA[Touch UI]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=3586</guid>

					<description><![CDATA[<p>For almost all cases of AEM implementations, adding validation for maximum items for the Granite UI Multifield is a must. In this article, we will put together a script that will register a new validator (foundation.validation.validator) to the foundation-registry (the foundation-registry is used in the Granite UI framework). In this solution, we will be utilizing [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/aem-granite-ui-multifield-maximum-items-validation">AEM Granite UI Multifield Maximum Items Validation</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>For almost all cases of AEM implementations, adding validation for maximum items for the Granite UI Multifield is a must. In this article, we will put together a script that will register a new validator (foundation.validation.validator) to the foundation-registry (the foundation-registry is used in the Granite UI framework). In this solution, we will be utilizing the jQuery Validation library (the validation library used by Granite UI is achieved by using the jQuery Validation plugin). </p>
<p><a href="https://sourcedcode.com/blog/aem/add-aem-custom-frontend-css-javascript-editor-html" rel="noopener" target="_blank">We must register a client library specifically targeting the author, which is specific to customizing page authoring</a>, which will inject JavaScript into the context of the page and execute the registry and scripts.</p>
<div class="mention-block">
After the installation of this validation code, you should be able to just include <strong>two additional properties</strong> to the <a href="https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/multifield/index.html" rel="noopener" target="_blank">multifield Granite UI component</a>, and it should be validating as expected:</p>
<p>Two fields:<br />
<strong>granite:class=&#8221;granite-ui-validation-multifield-max-items&#8221;</strong><br />
<strong>validation=&#8221;max-items-2&#8243;</strong></p>
<p>Example:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">&lt;navigationLinksMultifield</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">granite:class</span>=<span style="color: #ff0000;">&quot;granite-ui-validation-multifield-max-items&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">validation</span>=<span style="color: #ff0000;">&quot;max-items-2&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/multifield&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">composite</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;Navigation Links&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; ...</div></td></tr></tbody></table></div>
</div>
<hr class="spacer-large" />
<h2>Follow the steps below to have this setup</h2>
<div class="mention-block">
If you would like, completely download the clientlib-author client library <a href="https://sourcedcode.com/wp-content/uploads/2022/07/clientlib-author.zip">here</a>. This ZIP archive will include all the steps from 1-7.
</div>
<hr class="spacer-large" />
<h6> Step 1</h6>
<p>In your repository, create a new client library folder under your brand&#8217;s /apps/clientlib folder like:<br />
<span class="code-highlight-primary">path: ./sourcedcode/ui.apps/src/main/content/jcr_root/apps/sourcedcode/clientlibs/clientlib-author</span></p>
<p><a href="https://sourcedcode.com/wp-content/uploads/2022/07/clientlibrary-path.png"><img loading="lazy" decoding="async" src="https://sourcedcode.com/wp-content/uploads/2022/07/clientlibrary-path.png" alt="" width="1077" height="341" class="alignnone size-full wp-image-3597" srcset="https://sourcedcode.com/wp-content/uploads/2022/07/clientlibrary-path.png 1077w, https://sourcedcode.com/wp-content/uploads/2022/07/clientlibrary-path-300x95.png 300w, https://sourcedcode.com/wp-content/uploads/2022/07/clientlibrary-path-1024x324.png 1024w, https://sourcedcode.com/wp-content/uploads/2022/07/clientlibrary-path-768x243.png 768w, https://sourcedcode.com/wp-content/uploads/2022/07/clientlibrary-path-600x190.png 600w" sizes="(max-width: 1077px) 100vw, 1077px" /></a></p>
<hr class="spacer-large" />
<h6> Step 2</h6>
<p>In the newly created folder, create an .content.xml file and include the text found below:<br />
<span class="code-highlight-primary">path: ./sourcedcode/ui.apps/src/main/content/jcr_root/apps/sourcedcode/clientlibs/clientlib-author/.content.xml</span></p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<span style="color: #000000; font-weight: bold;">&lt;jcr:root</span> <span style="color: #000066;">xmlns:cq</span>=<span style="color: #ff0000;">&quot;http://www.day.com/jcr/cq/1.0&quot;</span> <span style="color: #000066;">xmlns:jcr</span>=<span style="color: #ff0000;">&quot;http://www.jcp.org/jcr/1.0&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;cq:ClientLibraryFolder&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">categories</span>=<span style="color: #ff0000;">&quot;[cq.authoring.editor.sites.page.hook]&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">dependencies</span>=<span style="color: #ff0000;">&quot;[cq.authoring.editor.sites.page]&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></div></td></tr></tbody></table></div>
<p>This method is specific to customizing page authoring in AEM, for more information about this topic, <a href="https://sourcedcode.com/blog/aem/add-aem-custom-frontend-css-javascript-editor-html" rel="noopener" target="_blank">click here</a>.</p>
<hr class="spacer-large" />
<h6> Step 3</h6>
<p>In the newly created folder, create an js folder (leave this empty).<br />
<span class="code-highlight-primary">path: ./sourcedcode/ui.apps/src/main/content/jcr_root/apps/sourcedcode/clientlibs/clientlib-author/js</span></p>
<hr class="spacer-large" />
<div class="mention-block">
If you would like, completely download the clientlib-author client library <a href="https://sourcedcode.com/wp-content/uploads/2022/07/clientlib-author.zip">here</a>. This ZIP archive will include all the steps from 1-7.
</div>
<hr class="spacer-large" />
<h6> Step 4</h6>
<p>In the newly created js folder, create a file named granite-ui-multifield-max-items.js and paste in the JavaScript found below:<br />
<span class="code-highlight-primary">path: ./sourcedcode/ui.apps/src/main/content/jcr_root/apps/sourcedcode/clientlibs/clientlib-author/js/granite-ui-multifield-max-items.js</span></p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br />101<br />102<br />103<br />104<br />105<br />106<br />107<br />108<br />109<br />110<br />111<br />112<br />113<br />114<br />115<br />116<br />117<br />118<br />119<br />120<br />121<br />122<br />123<br />124<br />125<br />126<br />127<br />128<br />129<br />130<br />131<br />132<br />133<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #339933;">;</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>$<span style="color: #339933;">,</span> Coral<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #3366CC;">'use strict'</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">/**<br />
&nbsp; &nbsp; &nbsp;* Granite UI Validation - Multifield Max Items<br />
&nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp;* @class MultifieldMaxItems<br />
&nbsp; &nbsp; &nbsp;* @classdesc registering Granite UI validation for the multifield maximum items.<br />
&nbsp; &nbsp; &nbsp;* This custom JavaScript validation ensures the number of multifield items does not exceed the maximum number<br />
&nbsp; &nbsp; &nbsp;* of items in the touch ui.<br />
&nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp;* Example Granite UI Multifield block:<br />
&nbsp; &nbsp; &nbsp;* &lt;navigationLinksMultifield<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr:primaryType=&quot;nt:unstructured&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; granite:class=&quot;granite-ui-validation-multifield-max-items&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; validation=&quot;max-items-2&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling:resourceType=&quot;granite/ui/components/coral/foundation/form/multifield&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ...<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> MultifieldMaxItems <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> CONST <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TARGET_GRANITE_UI<span style="color: #339933;">:</span> <span style="color: #3366CC;">'.granite-ui-validation-multifield-max-items'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VALIDATION_PROPERTY<span style="color: #339933;">:</span> <span style="color: #3366CC;">'validation'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VALIDATION_VALUE_PREFIX<span style="color: #339933;">:</span> <span style="color: #3366CC;">'max-items'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ERROR_MESSAGE<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Max allowed items is {0}'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ERROR_TOOLTIP_ID<span style="color: #339933;">:</span> Coral.<span style="color: #660066;">commons</span>.<span style="color: #660066;">getUID</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DEFAULT_MAX_SIZE<span style="color: #339933;">:</span> &nbsp;<span style="color: #CC0000;">100</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* Initializes the MultifieldMaxItems<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* @private<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">function</span> init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// if dialog does not exist on the page, escape.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>$<span style="color: #009900;">&#40;</span>CONST.<span style="color: #660066;">TARGET_GRANITE_UI</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// register foundation validation for multi-field, max size</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">adaptTo</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'foundation-registry'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">register</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'foundation.validation.validator'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; selector<span style="color: #339933;">:</span> CONST.<span style="color: #660066;">TARGET_GRANITE_UI</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; validate<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>el<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> max <span style="color: #339933;">=</span> _getMaxSizeValue<span style="color: #009900;">&#40;</span>el<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>el.<span style="color: #660066;">items</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> max<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> CONST.<span style="color: #660066;">ERROR_MESSAGE</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'{0}'</span><span style="color: #339933;">,</span> max<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; show<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>el<span style="color: #339933;">,</span> message<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _handleError<span style="color: #009900;">&#40;</span>el<span style="color: #339933;">,</span> message<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; clear<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>el<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> max <span style="color: #339933;">=</span> _getMaxSizeValue<span style="color: #009900;">&#40;</span>el<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>el.<span style="color: #660066;">items</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">&lt;=</span> max<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// set field to valid if max size fits within the rules</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> $el <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>el<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> fieldAPI <span style="color: #339933;">=</span> $el.<span style="color: #660066;">adaptTo</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'foundation-field'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>fieldAPI <span style="color: #339933;">&amp;&amp;</span> fieldAPI.<span style="color: #660066;">setInvalid</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldAPI.<span style="color: #660066;">setInvalid</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// remove tooltip</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#'</span> <span style="color: #339933;">+</span> CONST.<span style="color: #660066;">ERROR_TOOLTIP_ID</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* Gets the max-items value set in the &quot;validation&quot; granite ui property.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* @private<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* @param {HTMLElement} el is the validation HTML block with an existing validation attribute<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">function</span> _getMaxSizeValue<span style="color: #009900;">&#40;</span>el<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> validationName <span style="color: #339933;">=</span> el.<span style="color: #660066;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'data-'</span> <span style="color: #339933;">+</span> CONST.<span style="color: #660066;">VALIDATION_PROPERTY</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>validationName<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> max <span style="color: #339933;">=</span> validationName.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span>CONST.<span style="color: #660066;">VALIDATION_VALUE_PREFIX</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'-'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>max<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> parseInt<span style="color: #009900;">&#40;</span>max<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> CONST.<span style="color: #660066;">DEFAULT_MAX_SIZE</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* Handles the displaying of error messages<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* @private<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* @param {HTMLElement} el is the validation HTML block with an existing validation attribute<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* @param {String} message is error message returned by the validate method, in the registry of foundation.validation.validator.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">function</span> _handleError<span style="color: #009900;">&#40;</span>el<span style="color: #339933;">,</span> message<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> $el <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>el<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// set foundation field to show as invalid</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> fieldAPI <span style="color: #339933;">=</span> $el.<span style="color: #660066;">adaptTo</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'foundation-field'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>fieldAPI <span style="color: #339933;">&amp;&amp;</span> fieldAPI.<span style="color: #660066;">setInvalid</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldAPI.<span style="color: #660066;">setInvalid</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// set foundation field to show as invalid</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> error <span style="color: #339933;">=</span> $el.<span style="color: #660066;">data</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'foundation-validation.internal.error'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>error<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; error.<span style="color: #660066;">content</span>.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> message<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>error.<span style="color: #660066;">parentNode</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $el.<span style="color: #660066;">after</span><span style="color: #009900;">&#40;</span>error<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; error.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; error <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">new</span> Coral.<span style="color: #660066;">Tooltip</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; error.<span style="color: #660066;">variant</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'error'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; error.<span style="color: #660066;">interaction</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'off'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; error.<span style="color: #660066;">placement</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'bottom'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; error.<span style="color: #660066;">target</span> <span style="color: #339933;">=</span> el<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; error.<span style="color: #660066;">content</span>.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> message<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; error.<span style="color: #660066;">open</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; error.<span style="color: #660066;">id</span> <span style="color: #339933;">=</span> CONST.<span style="color: #660066;">ERROR_TOOLTIP_ID</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $el.<span style="color: #660066;">data</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'foundation-validation.internal.error'</span><span style="color: #339933;">,</span> error<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $el.<span style="color: #660066;">after</span><span style="color: #009900;">&#40;</span>error<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; init<span style="color: #339933;">:</span> init<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; MultifieldMaxItems.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #339933;">,</span> Coral<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<hr class="spacer-large" />
<h6> Step 5</h6>
<p>In your repository, create a css.txt and js.txt file<br />
<span class="code-highlight-primary">path: ./sourcedcode/ui.apps/src/main/content/jcr_root/apps/sourcedcode/clientlibs/clientlib-author/css.txt</span></p>
<p><span class="code-highlight-primary">path: ./sourcedcode/ui.apps/src/main/content/jcr_root/apps/sourcedcode/clientlibs/clientlib-author/js.txt</span></p>
<p>A valid client library must include these two files.</p>
<hr class="spacer-large" />
<h6> Step 6</h6>
<p>Edit the js.txt file to include:</p>
<p><span class="code-highlight-primary">path: ./sourcedcode/ui.apps/src/main/content/jcr_root/apps/sourcedcode/clientlibs/clientlib-author/js.txt</span></p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">#base=js<br />
granite-ui-multifield-max-items.js</div></td></tr></tbody></table></div>
<hr class="spacer-large" />
<h6> Step 7</h6>
<p>Edit your Granite UI Multifield component to include two new properties:<br />
<strong>granite:class=&#8221;granite-ui-validation-multifield-max-items&#8221;</strong><br />
<strong>validation=&#8221;max-items-2&#8243;</strong></p>
<p>Example: In this example, we have ensured that the maximum items that can be used in the multifield is 2 items.</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">&lt;navigationLinksMultifield</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">granite:class</span>=<span style="color: #ff0000;">&quot;granite-ui-validation-multifield-max-items&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">validation</span>=<span style="color: #ff0000;">&quot;max-items-2&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/multifield&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">composite</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;Navigation Links&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;field</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/container&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./navLinks&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;items</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;linkLabel</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/textfield&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;Link Label&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./linkLabel&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">required</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;linkPath</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/pathfield&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;Link Path&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./linkPath&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">required</span>=<span style="color: #ff0000;">&quot;true&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">rootPath</span>=<span style="color: #ff0000;">&quot;/content&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;linkTarget</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/select&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;CTA Link Target&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./linkTarget&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;items</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;self</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">selected</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">text</span>=<span style="color: #ff0000;">&quot;Same Page&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;_self&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;blank</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">text</span>=<span style="color: #ff0000;">&quot;New Tab&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;_blank&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/items<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/linkTarget<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/items<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<span style="color: #000000; font-weight: bold;">&lt;/navigationLinksMultifield<span style="color: #000000; font-weight: bold;">&gt;</span></span></div></td></tr></tbody></table></div>
<hr class="spacer-large" />
<h6> Step 8</h6>
<p>The Granite UI Multifield validation should be working as expected.</p>
<p><a href="https://sourcedcode.com/wp-content/uploads/2022/07/granite-ui-validation-multifield-max-items.png"><img decoding="async" src="https://sourcedcode.com/wp-content/uploads/2022/07/granite-ui-validation-multifield-max-items.png" alt="Granite UI Multifield Max Items Validation Screenshot" /></a></p>
<hr class="spacer-large" />
<div class="mention-block">
You have successfully added Granite UI Multifield maximum items validation! </p>
<p>For another in-depth tutorial for how to add Granite UI RichText Max Characters Length Validation, <a href="https://sourcedcode.com/blog/aem/touch-ui/aem-richtext-max-characters-length-validation">click here</a></div>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/aem-granite-ui-multifield-maximum-items-validation">AEM Granite UI Multifield Maximum Items Validation</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/aem-granite-ui-multifield-maximum-items-validation/feed</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Add AEM Custom Frontend CSS JavaScript Editor.html</title>
		<link>https://sourcedcode.com/blog/aem/add-aem-custom-frontend-css-javascript-editor-html</link>
					<comments>https://sourcedcode.com/blog/aem/add-aem-custom-frontend-css-javascript-editor-html#comments</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Sat, 16 Jul 2022 20:51:14 +0000</pubDate>
				<category><![CDATA[AEM]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Touch UI]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=3582</guid>

					<description><![CDATA[<p>I would like to re-share one of my existing blog articles on how to add a custom client library for the AEM Author Editor (editor.html). It&#8217;s a very simple configuration that requires one dependency and one client category. This method is specific to customizing page authoring in AEM. Click on this link for exactly how [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/add-aem-custom-frontend-css-javascript-editor-html">Add AEM Custom Frontend CSS JavaScript Editor.html</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I would like to re-share one of my existing blog articles on how to add a custom client library for the AEM Author Editor (editor.html). It&#8217;s a very simple configuration that requires one dependency and one client category. This method is specific to customizing page authoring in AEM.</p>
<p>Click on this link for exactly how this can be set up, <a href="https://sourcedcode.com/blog/aem/adding-custom-client-library-for-aem-author-editor-touch-ui">https://sourcedcode.com/blog/aem/adding-custom-client-library-for-aem-author-editor-touch-ui</a></p>
<p><strong>Usecases for adding custom CSS or JavaScript to the editor.html would be:</strong></p>
<ol>
<li>Including custom styling from the UI for the Granite UI fields.</li>
<li>Including custom Granite UI JavaScript validations such as <a href="https://sourcedcode.com/blog/aem/touch-ui/aem-richtext-max-characters-length-validation">richtext maximum characters</a> or multifield maximum items.</li>
<li>Including custom processes such as deleting component properties based on Granite UI configurations.</li>
<li>Including JavaScript injections into a page based on the window.location.pathname or searchParams.</li>
</ol>
<p>All in all, the sky is the limit on customizations that you can add to the editor.html. Click on this link for exactly how this can be set up, <a href="https://sourcedcode.com/blog/aem/adding-custom-client-library-for-aem-author-editor-touch-ui">https://sourcedcode.com/blog/aem/adding-custom-client-library-for-aem-author-editor-touch-ui</a></p>
<div class="mention-block">
If you want to learn how to create client libraries for the authoring environment that only target specific components checkout this article <a href="https://sourcedcode.com/blog/aem/what-are-aem-extraclientlibs">here</a>.
</div>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/add-aem-custom-frontend-css-javascript-editor-html">Add AEM Custom Frontend CSS JavaScript Editor.html</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/add-aem-custom-frontend-css-javascript-editor-html/feed</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Granite UI Multifield Sightly Traverse &#124; Iterate Simple Example</title>
		<link>https://sourcedcode.com/blog/aem/granite-ui-multifield-sightly-traverse-iterate-simple-example</link>
					<comments>https://sourcedcode.com/blog/aem/granite-ui-multifield-sightly-traverse-iterate-simple-example#comments</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Fri, 24 Jun 2022 01:58:27 +0000</pubDate>
				<category><![CDATA[AEM]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Sightly]]></category>
		<category><![CDATA[Touch UI]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=3526</guid>

					<description><![CDATA[<p>In this article, we will share an example on on how we can iterate and traverse through multifield nodes that have been generated by the Touch UI using Sightly in a very simple way. Going through this article, we will be setting up multifield Granite UI links (as if we are building a menu navigation). [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/granite-ui-multifield-sightly-traverse-iterate-simple-example">Granite UI Multifield Sightly Traverse | Iterate Simple Example</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In this article, we will share an example on on how we can iterate and traverse through multifield nodes that have been generated by the Touch UI using Sightly in a very simple way.</p>
<p>Going through this article, we will be setting up multifield Granite UI links (as if we are building a menu navigation). Each link will define it&#8217;s own path, label, and target. Take a look at both screenshots below. One screenshot indicates how a multifield Granite UI field will look like, and in the second screenshot displays how saved nodes would look like in the crx/de console.</p>
<p><a class="foobox fbx-instance fbx-link" href="https://sourcedcode.com/wp-content/uploads/2022/06/multi-list-1-1.png"><img decoding="async" src="https://sourcedcode.com/wp-content/uploads/2022/06/multi-list-1-1.png" alt="Touch UI - show casing multifield link configurations screenshot" /></a><br />
<a  class="foobox fbx-instance fbx-link"  href="https://sourcedcode.com/wp-content/uploads/2022/06/multi-list-2.png"><img decoding="async" src="https://sourcedcode.com/wp-content/uploads/2022/06/multi-list-2.png" alt="CRX/DE saved link nodes from the Touch UI screenshot" /></a></p>
<hr class="spacer-large"/>
<h3>Step 1. Touch UI Configuration</h3>
<p>Putting together a very basic Touch UI configuration using tabs to organize our Granite UI fields. Here we will place the entire configuration under:<br />
<strong>/apps/sourcedcode/components/content/multilistexample/_cq_dialog/.content.xml</strong>. </p>
<p>line: 34, declaring a multifield<br />
line: 42, declaring multifield > label<br />
line: 48, declaring multifield > path<br />
line: 55, declaring multifield > target</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;jcr:root</span> <span style="color: #000066;">xmlns:sling</span>=<span style="color: #ff0000;">&quot;http://sling.apache.org/jcr/sling/1.0&quot;</span> <span style="color: #000066;">xmlns:cq</span>=<span style="color: #ff0000;">&quot;http://www.day.com/jcr/cq/1.0&quot;</span> <span style="color: #000066;">xmlns:jcr</span>=<span style="color: #ff0000;">&quot;http://www.jcp.org/jcr/1.0&quot;</span> <span style="color: #000066;">xmlns:nt</span>=<span style="color: #ff0000;">&quot;http://www.jcp.org/jcr/nt/1.0&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">jcr:title</span>=<span style="color: #ff0000;">&quot;Multi List Example&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;cq/gui/components/authoring/dialog&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;content</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/foundation/container&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;layout</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/foundation/layouts/tabs&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;nav&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;items</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;generalSettings</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:title</span>=<span style="color: #ff0000;">&quot;General Settings&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/foundation/section&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;layout</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/foundation/layouts/fixedcolumns&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;nav&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;items</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/container&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;items</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;linkOptions</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:title</span>=<span style="color: #ff0000;">&quot;Links Options&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/fieldset&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;items</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;links</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/multifield&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">composite</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;Links&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/container&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./links&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;items</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;linkLabel</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/textfield&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;Link Label&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./linkLabel&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">required</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;linkPath</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/pathfield&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;Link Path&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./linkPath&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">required</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">rootPath</span>=<span style="color: #ff0000;">&quot;/content&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;linkTarget</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/select&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;Link Target&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./linkTarget&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;items</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;self</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">selected</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">text</span>=<span style="color: #ff0000;">&quot;Same Page&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;_self&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;blank</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">text</span>=<span style="color: #ff0000;">&quot;New Tab&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;_blank&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/items<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/linkTarget<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/items<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/links<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/items<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/linkOptions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/items<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/column<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/items<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/generalSettings<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/items<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/content<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/jcr:root<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<hr class="spacer-large"/>
<h3>Step 2. Sightly HTL Front-end</h3>
<p>A very simple way to get a list of objects to iterate through will be to use Sling Model&#8217;s backend and Sling Specific Annotations. Together the mechanism combined will enable the Sightly HTL code to receive a List<Resource>, which you can use this list to iterate through each item, to display nav link configurations that were set by the authors.</p>
<p>Using the Sightly <strong>data-sly-list</strong> API, we can traverse through each item from the List<Resources>. Iterating through each item returns an Resource.class onbject, which it has a getValueMap() public getter method. With this getter method we can get the valueMap object and reveal the configurations that are set by the authors.</p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cmp-multilistexample&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; data-sly-use.cmp<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;com.sourcedcode.core.models.content.MultiListExample&quot;</span>&gt;</span><br />
&nbsp; <span style="color: #009900;">&lt;sly data-sly-list.<span style="color: #000066;">link</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;${cmp.links}&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;${link.valueMap.linkPath}&quot;</span> <span style="color: #000066;">target</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;${link.valueMap.linkTarget}&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;noopener&quot;</span>&gt;</span>${link.valueMap.linkLabel}<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>sly&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></div></td></tr></tbody></table></div>
<hr class="spacer-large"/>
<h3>Step 3. Sling Model Java Backend</h3>
<p>Sling Model&#8217;s backend and Sling Specific Annotations. Together the mechanism combined will enable the Sightly HTL code to receive a List<Resource>.</p>
<div class="mention-block">
<strong>Pro Tip:</strong><br />
<strong>Decrease your AEM development time using our AEM Sling Model Cheat Sheet Reference Guide! <a href="https://sourcedcode.com/blog/aem/aem-sling-model-injectors-annotations-cheat-sheet-reference-guide" rel="noopener" target="_blank">View Guide</a></strong>.
</div>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.sourcedcode.core.models.content</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">lombok.Getter</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.sling.api.resource.Resource</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.sling.models.annotations.DefaultInjectionStrategy</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.sling.models.annotations.Model</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.sling.models.annotations.injectorspecific.ChildResource</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.inject.Named</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.List</span><span style="color: #339933;">;</span><br />
<br />
@Model<span style="color: #009900;">&#40;</span>adaptables <span style="color: #339933;">=</span> Resource.<span style="color: #000000; font-weight: bold;">class</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; defaultInjectionStrategy <span style="color: #339933;">=</span> DefaultInjectionStrategy.<span style="color: #006633;">OPTIONAL</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> MultiListExample <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; @Getter<br />
&nbsp; &nbsp; @ChildResource<br />
&nbsp; &nbsp; @Named<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;links&quot;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> List<span style="color: #339933;">&lt;</span>Resource<span style="color: #339933;">&gt;</span> links<span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<hr class="spacer-large"/>
<h3>Step 4. Results</h3>
<p>Work your maven magic, and build the code. Once your backend bundle and Sightly HTL code are aligned, you should be able to see the links like here in the screenshot.<br />
<a class="foobox fbx-instance fbx-link"  href="https://sourcedcode.com/wp-content/uploads/2022/06/multi-list-3.png"><img decoding="async" src="https://sourcedcode.com/wp-content/uploads/2022/06/multi-list-3.png" alt="Links Results" /></a></p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/granite-ui-multifield-sightly-traverse-iterate-simple-example">Granite UI Multifield Sightly Traverse | Iterate Simple Example</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/granite-ui-multifield-sightly-traverse-iterate-simple-example/feed</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Adding Custom Client Library for AEM Author Editor Touch UI</title>
		<link>https://sourcedcode.com/blog/aem/adding-custom-client-library-for-aem-author-editor-touch-ui</link>
					<comments>https://sourcedcode.com/blog/aem/adding-custom-client-library-for-aem-author-editor-touch-ui#respond</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Wed, 22 Jun 2022 19:03:57 +0000</pubDate>
				<category><![CDATA[AEM]]></category>
		<category><![CDATA[Client Libraries]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Touch UI]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=3484</guid>

					<description><![CDATA[<p>You can use Clientlibs to extend the default implementation and add new functionality while reusing the default functions, objects, and methods. When customizing, you can create your own clientlib under / apps. Specifically, when you want to add CSS or JavaScript to your AEM Author Editor, Touch UI Dialogs, you would want to create a [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/adding-custom-client-library-for-aem-author-editor-touch-ui">Adding Custom Client Library for AEM Author Editor Touch UI</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>You can use Clientlibs  to extend the default implementation and add new functionality while reusing the default functions, objects, and methods. When customizing, you can create your own clientlib under / apps. </p>
<p>Specifically, when you want to add CSS or JavaScript to your AEM Author Editor, Touch UI Dialogs, you would want to create a new client library. Within your clientlib, it must have the required dependencies and categories. </p>
<div class="mention-block">
If you want to learn how to create client libraries for the authoring environment that only target specific components checkout this article <a href="https://sourcedcode.com/blog/aem/what-are-aem-extraclientlibs">here</a>.
</div>
<p><strong>The custom clientlib for AEM authoring must follow these rules:</strong></p>
<p>1. depend on the authoring clientlib cq.authoring.editor.sites.page<br />
2. be part of the appropriate cq.authoring.editor.sites.page.hook category</p>
<hr class="divider-large"/>
<h3>Example</h3>
<p>An example of a custom client library created for AEM authoring would live in this path (below), and must have the .context.xml configured like so.<br />
<strong>/apps/sourcedcode/clientlibs/clientlib-authoring</strong></p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<span style="color: #000000; font-weight: bold;">&lt;jcr:root</span> <span style="color: #000066;">xmlns:cq</span>=<span style="color: #ff0000;">&quot;http://www.day.com/jcr/cq/1.0&quot;</span> <span style="color: #000066;">xmlns:jcr</span>=<span style="color: #ff0000;">&quot;http://www.jcp.org/jcr/1.0&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;cq:ClientLibraryFolder&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">dependencies</span>=<span style="color: #ff0000;">&quot;[cq.authoring.editor.sites.page]&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">categories</span>=<span style="color: #ff0000;">&quot;[cq.authoring.editor.sites.page.hook]&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></div></td></tr></tbody></table></div>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/adding-custom-client-library-for-aem-author-editor-touch-ui">Adding Custom Client Library for AEM Author Editor Touch UI</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/adding-custom-client-library-for-aem-author-editor-touch-ui/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Write AEM Reusable Touch UI, Granite UI Configuration</title>
		<link>https://sourcedcode.com/blog/aem/how-to-write-aem-reusable-touch-ui-granite-ui-configuration</link>
					<comments>https://sourcedcode.com/blog/aem/how-to-write-aem-reusable-touch-ui-granite-ui-configuration#respond</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Fri, 21 Jan 2022 05:59:19 +0000</pubDate>
				<category><![CDATA[AEM]]></category>
		<category><![CDATA[Short Post]]></category>
		<category><![CDATA[Touch UI]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=3383</guid>

					<description><![CDATA[<p>Why are we repeating ourselves, writing the same Touch UI (Granite UI Component) configuration again and again as developers? It&#8217;s been like the 10th time that we have created a Granite UI Component configuration, an identical block of code. The RTE Granite UI Component should only contain basic format options. Is there a way for [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/how-to-write-aem-reusable-touch-ui-granite-ui-configuration">How to Write AEM Reusable Touch UI, Granite UI Configuration</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Why are we repeating ourselves, writing the same Touch UI (Granite UI Component) configuration again and again as developers? It&#8217;s been like the 10th time that we have created a Granite UI Component configuration, an identical block of code. <strong>The RTE Granite UI Component should only contain basic format options</strong>. Is there a way for developers to write this configuration once, so it can be reused? The answer is yes.</p>
<p>Introducing the DRY way of using <a href="https://sourcedcode.com/blog/aem/dry-way-of-using-richtext-granite-ui-component-in-aem-for-static-templates" rel="noopener" target="_blank">RichText Granite UI Component in AEM for Static Templates</a>, which is an article for how developers can write better and reusable code for Touch UI (Granite UI) configuration.</p>
<p>The blog article specifically focuses on the Rich Text Granite UI Component, configuration once, and then reuse it over and over again. The same methodology can be applied to all other Granite UI Component configurations; checkbox, select, color picker, text, etc&#8230; This is great because if there is a requirement, for example, to add in a new styles option, you can make the change once, and all other Granite UI Component configurations will pick this change up.</p>
<p>Visit the <a href="https://sourcedcode.com/blog/aem/dry-way-of-using-richtext-granite-ui-component-in-aem-for-static-templates" rel="noopener" target="_blank">DRY way of using RichText Granite UI Component in AEM for Static Templates</a></p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/how-to-write-aem-reusable-touch-ui-granite-ui-configuration">How to Write AEM Reusable Touch UI, Granite UI Configuration</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/how-to-write-aem-reusable-touch-ui-granite-ui-configuration/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>ACS Commons multi-field extension, acs-commons-nested, checkbox is not working</title>
		<link>https://sourcedcode.com/blog/aem/acs-commons-multi-field-extension-acs-commons-nested-checkbox-not-working</link>
					<comments>https://sourcedcode.com/blog/aem/acs-commons-multi-field-extension-acs-commons-nested-checkbox-not-working#respond</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Wed, 08 Dec 2021 21:28:31 +0000</pubDate>
				<category><![CDATA[AEM]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Touch UI]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=3097</guid>

					<description><![CDATA[<p>This article will provide a solution to the ACS Commons multi-field extension, checkbox Granite UI Component. While utilizing the ACS Commons multi-field extension, for everything I tried, I am not able to get the checkbox Granite UI component working as expected. Not an elegant way to solve the problem, but something that actually works and [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/acs-commons-multi-field-extension-acs-commons-nested-checkbox-not-working">ACS Commons multi-field extension, acs-commons-nested, checkbox is not working</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This article will provide a solution to the ACS Commons multi-field extension, checkbox Granite UI Component.</p>
<p>While utilizing the ACS Commons multi-field extension, for everything I tried, I am not able to get the checkbox Granite UI component working as expected. Not an elegant way to solve the problem, but something that actually works and is sustainable.</p>
<p>I found a solution that is simple. Instead of using the checkbox Granite UI Component, use the select Granite UI Component, granite/ui/components/coral/foundation/form/select. This works; problem solved.</p>
<div class="mention-block">Scroll near the bottom of this page to find the example code where the solution can be found.</div>
<hr class="spacer-large"/>
<h3>Not Working Checkbox</h3>
<p>As you can see here, in line:24, the acs-commons-nested property is not picking up the Granite UI Component, checkbox.</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #339933;">&lt;</span>links<br />
&nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/foundation/form/multifield&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; <span style="color: #339933;">&lt;</span>field<br />
&nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/foundation/form/fieldset&quot;</span><br />
&nbsp; &nbsp; acs<span style="color: #339933;">-</span>commons<span style="color: #339933;">-</span>nested<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span><br />
&nbsp; &nbsp; name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;./links&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>items jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>column<br />
&nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/foundation/container&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>items jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>linkTitle<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/form/textfield&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldLabel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Link Title&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;./linkTitle&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>linkPath<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/foundation/form/pathbrowser&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldLabel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Link Path&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;./linkPath&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>isChecked<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/form/checkbox&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldLabel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;isChecked?&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;./isChecked&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; text<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;isChecked flag&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; uncheckedValue<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{Boolean}false&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{Boolean}true&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>items<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>column<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>items<span style="color: #339933;">&gt;</span><br />
&nbsp; <span style="color: #339933;">&lt;/</span>field<span style="color: #339933;">&gt;</span><br />
<span style="color: #339933;">&lt;/</span>links<span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div>
<hr class="spacer-large"/>
<h3>Solved: Working Boolean</h3>
<p>In line:24, replacing the checkbox with the select Granite UI Component, solves the issue.</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #339933;">&lt;</span>links<br />
&nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/foundation/form/multifield&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; <span style="color: #339933;">&lt;</span>field<br />
&nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/foundation/form/fieldset&quot;</span><br />
&nbsp; &nbsp; acs<span style="color: #339933;">-</span>commons<span style="color: #339933;">-</span>nested<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span><br />
&nbsp; &nbsp; name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;./links&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>items jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>column<br />
&nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/foundation/container&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>items jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>linkTitle<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/form/textfield&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldLabel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Link Title&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;./linkTitle&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>linkPath<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/foundation/form/pathbrowser&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldLabel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Link Path&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;./linkPath&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>isChecked<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/form/select&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldLabel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;isChecked&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;./isChecked&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>items jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span><span style="color: #000066; font-weight: bold;">false</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; selected<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{Boolean}true&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; text<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;False&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{Boolean}false&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span><span style="color: #000066; font-weight: bold;">true</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; text<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;True&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{Boolean}true&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>items<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>isChecked<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>items<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>column<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>items<span style="color: #339933;">&gt;</span><br />
&nbsp; <span style="color: #339933;">&lt;/</span>field<span style="color: #339933;">&gt;</span><br />
<span style="color: #339933;">&lt;/</span>links<span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/acs-commons-multi-field-extension-acs-commons-nested-checkbox-not-working">ACS Commons multi-field extension, acs-commons-nested, checkbox is not working</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/acs-commons-multi-field-extension-acs-commons-nested-checkbox-not-working/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>AEM RichText Remove P Tag, removeSingleParagraphContainer, for Touch UI</title>
		<link>https://sourcedcode.com/blog/aem/aem-richtext-remove-p-tag-removesingleparagraphcontainer-for-touch-ui</link>
					<comments>https://sourcedcode.com/blog/aem/aem-richtext-remove-p-tag-removesingleparagraphcontainer-for-touch-ui#comments</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Fri, 29 Oct 2021 07:30:14 +0000</pubDate>
				<category><![CDATA[AEM]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Touch UI]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=3001</guid>

					<description><![CDATA[<p>You may have been trying to search the internet for an out of box solution to remove the single paragraph container for Touch UI, and have found something like removeSingleParagraphContainer. But however, this attribute was for the Classic UI and deprecated. From my knowledge, there isn&#8217;t anything out of the box that can remove the [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/aem-richtext-remove-p-tag-removesingleparagraphcontainer-for-touch-ui">AEM RichText Remove P Tag, removeSingleParagraphContainer, for Touch UI</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>You may have been trying to search the internet for an out of box solution to remove the single paragraph container for Touch UI, and have found something like removeSingleParagraphContainer. But however, this attribute was for the Classic UI and deprecated. From my knowledge, there isn&#8217;t anything out of the box that can remove the p single paragraph container tag. However, I have spent some time and found a very lucrative solution. Lets remove the p tag from the rich text editor!</p>
<p>In this article, we will step through my implementation for us to remove the p tag once and for all, from being rendered. </p>
<p>My solution to this problem will be dealt with in the backend, Sling Model. Some may argue that the solution can be done using Javascript, but that can be very troublesome. Let&#8217;s Keep it Simple Stupid (KISS). There&#8217;s one caveat to this approach; scroll to the bottom of the page to see what it is.</p>
<p>Follow my 3 steps below to remove the P tag wrapper from what is being produced by the cq/gui/components/authoring/dialog/richtext.</p>
<p><iframe loading="lazy" width="560" height="315" src="https://www.youtube.com/embed/WSS1Tfau4dc" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></p>
<hr class="spacer-large"/>
<h3>Step 1. Add Custom Option In the Paraformat Options</h3>
<p>Under the _cq_dialog.xml, <strong>cq/gui/components/authoring/dialog/richtext</strong>, add a new format option under the paraformat list of options. </p>
<p>The selected paraformat option will be a custom HTML element that wraps onto the highlighted or selected text from the author. In this case, when the author have selected text, and then click on the new paraformat option, the Html will look something like this <span class="code-highlight-primary">&lt;notextformat&gt;sometext&lt;/notextformat&gt;</span>.</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br />101<br />102<br />103<br />104<br />105<br />106<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">// new paraformt to be added into line:77<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;notextformat</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;No - Text Format&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">tag</span>=<span style="color: #ff0000;">&quot;notextformat&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
// the complete _cq_dialog.xml configuration for the cq/gui/components/authoring/dialog/richtext<br />
// new paraformt to be added into line:77<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;text</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;cq/gui/components/authoring/dialog/richtext&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./text&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">useFixedInlineToolbar</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rtePlugins</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;format</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">features</span>=<span style="color: #ff0000;">&quot;bold,italic&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;justify</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">features</span>=<span style="color: #ff0000;">&quot;-&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;links</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">features</span>=<span style="color: #ff0000;">&quot;modifylink,unlink&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;lists</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">features</span>=<span style="color: #ff0000;">&quot;*&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;paraformat</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">features</span>=<span style="color: #ff0000;">&quot;*&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;formats</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;default_p</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Paragraph&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">tag</span>=<span style="color: #ff0000;">&quot;p&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;default_h1</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Heading 1&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">tag</span>=<span style="color: #ff0000;">&quot;h1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;default_h2</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Heading 2&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">tag</span>=<span style="color: #ff0000;">&quot;h2&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;default_h3</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Heading 3&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">tag</span>=<span style="color: #ff0000;">&quot;h3&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;default_h4</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Heading 4&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">tag</span>=<span style="color: #ff0000;">&quot;h4&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;default_h5</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Heading 5&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">tag</span>=<span style="color: #ff0000;">&quot;h5&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;default_h6</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Heading 6&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">tag</span>=<span style="color: #ff0000;">&quot;h6&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;default_blockquote</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Quote&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">tag</span>=<span style="color: #ff0000;">&quot;blockquote&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;default_pre</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Preformatted&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">tag</span>=<span style="color: #ff0000;">&quot;pre&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;notextformat</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;No - Text Format&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">tag</span>=<span style="color: #ff0000;">&quot;notextformat&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/formats<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/paraformat<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rtePlugins<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;uiSettings</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;cui</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;inline</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">toolbar</span>=<span style="color: #ff0000;">&quot;[format#bold,format#italic,format#underline,#justify,#lists,links#modifylink,links#unlink,#paraformat]&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;popovers</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;justify</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">items</span>=<span style="color: #ff0000;">&quot;[justify#justifyleft,justify#justifycenter,justify#justifyright]&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">ref</span>=<span style="color: #ff0000;">&quot;justify&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;lists</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">items</span>=<span style="color: #ff0000;">&quot;[lists#unordered,lists#ordered,lists#outdent,lists#indent]&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">ref</span>=<span style="color: #ff0000;">&quot;lists&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;paraformat</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">items</span>=<span style="color: #ff0000;">&quot;paraformat:getFormats:paraformat-pulldown&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">ref</span>=<span style="color: #ff0000;">&quot;paraformat&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/popovers<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/inline<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/cui<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/uiSettings<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/text<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<hr class="spacer-larger"/>
<h3>Step 2. Create the Backend, Sling Model, to Text Transform</h3>
<p>The backend Sling Model will read the ./text property that has been set by the user&#8217;s input. Using the String.ReplaceAll(), we can replace all <span class="code-highlight-secondary">&lt;/?notextformat&gt;</span>, regex pattern, with nothing (meaning that this element will be removed).</p>
<p>For example <span class="code-highlight-primary">&lt;notextformat&gt;sometext&lt;/notextformat&gt;</span>. -> <span class="code-highlight-primary">sometext</span>.</p>
<p>We next save the formatted text into a variable of <span class="code-highlight-secondary"richText</span>, which can be used by sightly to display HTML on the page.</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.sourcedcode.core.models</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.sling.api.resource.Resource</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.sling.models.annotations.Default</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.sling.models.annotations.Model</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.sling.models.annotations.Optional</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.sling.models.annotations.injectorspecific.ValueMapValue</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.annotation.PostConstruct</span><span style="color: #339933;">;</span><br />
<br />
@Model<span style="color: #009900;">&#40;</span>adaptables<span style="color: #339933;">=</span>Resource.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> MyTextComponent <span style="color: #009900;">&#123;</span><br />
<br />
&nbsp; &nbsp; @Optional<br />
&nbsp; &nbsp; @ValueMapValue<br />
&nbsp; &nbsp; @<span style="color: #000000; font-weight: bold;">Default</span><span style="color: #009900;">&#40;</span>values <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> text<span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> richText<span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; @PostConstruct<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000066; font-weight: bold;">void</span> init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>text.<span style="color: #006633;">isEmpty</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; richText <span style="color: #339933;">=</span> text.<span style="color: #006633;">replaceAll</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&lt;/?notextformat&gt;&quot;</span>, <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getRichText<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> richText<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<hr class="spacer-larger"/>
<h3>Step 3. Render Text Transform from Sightly</h3>
<p>Now finally we just need to utilise sightly to print the text transformed, <span class="code-highlight-primary">richText</span>, to the screen.</p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #009900;">&lt;sly data-sly-use.myTextComponent<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;com.sourcedcode.core.models.MyTextComponent&quot;</span><span style="color: #66cc66;">/</span>&gt;</span><br />
${myTextComponent.richText @ context='html'}<br />
<span style="color: #009900;">&lt;sly data-sly-use.templates<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;core/wcm/components/commons/v1/templates.html&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; data-sly-call<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;${templates.placeholder @ isEmpty = !myTextComponent.richText}&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span>sly&gt;</span></div></td></tr></tbody></table></div>
<hr class="spacer-large"/>
<div class="mention-block">
<strong>Last Thoughts?</strong><br />
The caveat with this approach is that when you are trying to export JSON format from this component, you will be stuck with this block of text, <span class="code-highlight-primary">&lt;notextformat&gt;sometext&lt;/notextformat&gt;</span>, unless if you text to transform the export as well.</p>
<p>The reason why I did not overwrite the JCR values is that I wanted to retain the natural editing experience for the authors. With my solution when the author decides to make changes to the rich text field, they would not have a werid experience.
</p></div>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/aem-richtext-remove-p-tag-removesingleparagraphcontainer-for-touch-ui">AEM RichText Remove P Tag, removeSingleParagraphContainer, for Touch UI</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/aem-richtext-remove-p-tag-removesingleparagraphcontainer-for-touch-ui/feed</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
		<item>
		<title>AEM RichText TouchUI, Enabling Code Editor, Source Edit</title>
		<link>https://sourcedcode.com/blog/aem/aem-richtext-touchui-enabling-code-editor-source-edit</link>
					<comments>https://sourcedcode.com/blog/aem/aem-richtext-touchui-enabling-code-editor-source-edit#respond</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Fri, 22 Oct 2021 02:17:46 +0000</pubDate>
				<category><![CDATA[AEM]]></category>
		<category><![CDATA[Touch UI]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=2956</guid>

					<description><![CDATA[<p>Sometimes we need to give our power content authors, the flexibility to review their HTML markup from the richText editor, so they can ensure that the semantics are looking as expected. As AEM developers we are summoned to enable and deliver this requirement. In this article, I will provide a code example on how we [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/aem-richtext-touchui-enabling-code-editor-source-edit">AEM RichText TouchUI, Enabling Code Editor, Source Edit</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Sometimes we need to give our power content authors, the flexibility to review their HTML markup from the richText editor, so they can ensure that the semantics are looking as expected. </p>
<p>As AEM developers we are summoned to enable and deliver this requirement. In this article, I will provide a code example on how we can enable the code editor for the rich text editor. Technically, we call this feature the <b>source edit</b> when referring to this feature from the rtePlugins.</p>
<p>The source edit feature is actually a feature from the misctools rtePlugin. Simply add the rtePlugins > misctools with the feature set as <span class="code-highlight-primary">sourceedit</span>. Next add the toolbar configuration value of <span class="code-highlight-primary">misctools#sourceedit</span>, for the inline &#038;&#038; dialogFullScreen node. See the code example below.</p>
<p>For sightly, make sure you use the context attribute, <span class="code-highlight-primary">${properties.text @ context=&#8217;html&#8217;}</span></p>
<div class="code-larger">
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<span style="color: #000000; font-weight: bold;">&lt;jcr:root</span> <span style="color: #000066;">xmlns:sling</span>=<span style="color: #ff0000;">&quot;http://sling.apache.org/jcr/sling/1.0&quot;</span> <span style="color: #000066;">xmlns:granite</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/jcr/granite/1.0&quot;</span> <span style="color: #000066;">xmlns:cq</span>=<span style="color: #ff0000;">&quot;http://www.day.com/jcr/cq/1.0&quot;</span> <span style="color: #000066;">xmlns:jcr</span>=<span style="color: #ff0000;">&quot;http://www.jcp.org/jcr/1.0&quot;</span> <span style="color: #000066;">xmlns:nt</span>=<span style="color: #ff0000;">&quot;http://www.jcp.org/jcr/nt/1.0&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:title</span>=<span style="color: #ff0000;">&quot;Text&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;cq/gui/components/authoring/dialog&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">helpPath</span>=<span style="color: #ff0000;">&quot;https://www.adobe.com/go/aem_cmp_text_v2&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">trackingFeature</span>=<span style="color: #ff0000;">&quot;core-components:text:v2&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;content</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/container&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;items</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;tabs</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/tabs&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">maximized</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;items</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;properties</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:title</span>=<span style="color: #ff0000;">&quot;Properties&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/container&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">margin</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;items</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;columns</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/fixedcolumns&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">margin</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;items</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;column</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/container&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;items</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;text</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;cq/gui/components/authoring/dialog/richtext&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./text&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">useFixedInlineToolbar</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;rtePlugins</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;misctools</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">features</span>=<span style="color: #ff0000;">&quot;[sourceedit]&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/rtePlugins<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;uiSettings</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;cui</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;inline</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">toolbar</span>=<span style="color: #ff0000;">&quot;[misctools#sourceedit]&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;dialogFullScreen</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">toolbar</span>=<span style="color: #ff0000;">&quot;[misctools#sourceedit]&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/cui<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/uiSettings<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/text<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/items<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/column<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/items<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/columns<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/items<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/properties<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/items<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/tabs<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/items<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/content<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<span style="color: #000000; font-weight: bold;">&lt;/jcr:root<span style="color: #000000; font-weight: bold;">&gt;</span></span></div></td></tr></tbody></table></div>
</div>
<div class="mention-block">
<b>My last thoughts for this enabled feature.</b><br />
I really think the code editor for the AEM richText editor Touch UI is really useful because, now power authors can review HTML elements that will be inserted into the page, making sure that they can fix syntax errors before publishing the page. In this way, it will keep the SEO team happy, and allow HTML elements on the page to be W3C compliant.</p>
<p>But however, with great power comes great responsibilities; enabling this feature will allow authors to add the markup they require.
</p></div>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/aem-richtext-touchui-enabling-code-editor-source-edit">AEM RichText TouchUI, Enabling Code Editor, Source Edit</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/aem-richtext-touchui-enabling-code-editor-source-edit/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>DRY way of using RichText Granite UI Component in AEM for Static Templates</title>
		<link>https://sourcedcode.com/blog/aem/dry-way-of-using-richtext-granite-ui-component-in-aem-for-static-templates</link>
					<comments>https://sourcedcode.com/blog/aem/dry-way-of-using-richtext-granite-ui-component-in-aem-for-static-templates#respond</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Mon, 21 Jun 2021 01:14:04 +0000</pubDate>
				<category><![CDATA[AEM]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Touch UI]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=2811</guid>

					<description><![CDATA[<p>Every developer have experienced a situation where they are working with AEM multiple AEM components, where Touch UI dialogues consist of a common richtext Granite UI component configuration cq/gui/components/authoring/dialog/richtext. When I mention common richtext Granite UI component, I mean there are multiple AEM components that will have the richtext Granite UI component as one of [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/dry-way-of-using-richtext-granite-ui-component-in-aem-for-static-templates">DRY way of using RichText Granite UI Component in AEM for Static Templates</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Every developer have experienced a situation where they are working with AEM multiple AEM components, where Touch UI dialogues consist of a common richtext Granite UI component configuration <a href="https://gist.github.com/briankasingli/1a7e3e12deaa2e076645b09d30039b46" target="_blank" rel="noopener">cq/gui/components/authoring/dialog/richtext</a>. When I mention common richtext Granite UI component, I mean there are multiple AEM components that will have the richtext Granite UI component as one of it&#8217;s input fields, where only the &#8220;links*&#8221; and &#8220;format*&#8221; richtext features are enabled, as an example.</p>
<p>Enabling only the &#8220;links*&#8221; and &#8220;format*&#8221; richtext features, we catch ourselves repeating lines of code by copying and pasting the entire block of code for all of our Touch UI dialogues that require the richtext requirement. This works, but this is Write Everything Twice, &#8220;WET&#8221; code, and it&#8217;s not good implementation; this can be improved. What happens if there is a new requirement where the authors would like a new capability to the richtext field? Will we have to edit multiple dialogues? (like editing 20 component&#8217;s dialogues) The short answer is Yes. With this &#8220;WET&#8221; implementation, you must edit every single component&#8217;s dialogue configuration.</p>
<p><b>How can we do this better? How keep our code Don&#8217;t Repeat Yourself (DRY)?</b></p>
<p>Utilising the Granite UI component, <span class="code-highlight-secondary"><a href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/include/index.html" rel="noopener nofollow" target="_blank">granite/ui/components/coral/foundation/include</a></span>, we are able to refer to common Granite UI component configurations in the JCR (that we are going to set up). Now changing the richtext configuration in one place will provide TouchUI dialogue changes to all 20+ components; see diagram below.</p>
<div class="mention-block">
<b>Implementation Quick Links</b></p>
<ol>
<li><a href="#register">IMPL: Register the common dialog namespace</a></li>
<li><a href="#create-and-configure">IMPL: Create and configure the common Granite UI component configurations, under the “fields” structure</a></li>
<li><a href="#include">IMPL: From the targeted component, include the common Granite UI config</a></li>
<li><a href="#done">IMPL: Done</a></li>
</ol>
</div>
<p><b>Advantages of using common richtext configurations</b></p>
<ul>
<li>Ease to read and maintain</li>
<li>Reusability of the code</li>
<li>Reduces uneseccary lines of code in the repo</li>
<li>common Granite UI configs are easily accessible to manipulate</li>
</ul>
<p><a class="foobox" href="https://sourcedcode.com/wp-content/uploads/2021/06/common-granite-ui-fields-touch-ui-ref.png"><img decoding="async" src="https://sourcedcode.com/wp-content/uploads/2021/06/common-granite-ui-fields-touch-ui-ref.png" alt="Multiple AEM components' Touch UI dialogue utilises the common Granite UI component configuration in the JCR, for the richtext Granite UI component configurations." class="aligncenter" /></a></p>
<p>With the improvement, with the diagram above, you will notice multiple AEM components&#8217; Touch UI dialogue utilises the common Granite UI component configuration in the JCR, for the richtext Granite UI component configurations.</p>
<hr class="spacer-larger"/>
<h2 id="implementation">The Implementation</h2>
<p>In this section, code will be shared on how this configuration can be applied to your own AEM implementation. The example produced will be a summary of the diagram from <a class="foobox" href="https://sourcedcode.com/wp-content/uploads/2021/06/common-granite-ui-fields-touch-ui-ref.png" title="Multiple AEM components' Touch UI dialogue utilises the common Granite UI component configuration in the JCR, for the richtext Granite UI component configurations.">above</a>.</p>
<div class="mention-block">We will be creating a common richtext Granite UI configuration which will be referenced by a example component.</div>
<hr class="spacer-large"/>
<h3 id="register">1. Register the common dialog namespace</h3>
<p>We typically place the common Granite UI component configurations for &#8220;content TouchUI&#8221; in the JCR under a namespaced project, for example: /apps/sourcedcodeaem/components/dialogs/content/common.</p>
<p>You will notice that there are already 3 folders that I have created.</p>
<ol>
<li><b>fields</b> &#8211; fields that are commonly used by Touch UI dialogue configs (<span class="code-highlight-primary">for this article we will only be focusing on these configs</span>)</li>
<li><b>fieldsets</b> &#8211; fieldsets that are commonly used by Touch UI dialogue configs; these consist of more than 1 Granite UI component which is wrapped around a granite/ui/components/foundation/container.</li>
<li><b>tabs</b> &#8211; tabs that are commonly used by Touch UI dialogue configs; these consist of more than 1 Granite UI component which is wrapped around a granite/ui/components/foundation/container.</li>
</ol>
<hr class="spacer-large"/>
<h3 id="create-and-configure">2. Create and configure the common Granite UI component configurations, under the &#8220;fields&#8221; structure</h3>
<p>/apps/sourcedcodeaem/components/dialogs/content/common/<span class="code-highlight-primary">fields</span>/_cq_dialog/.content.xml</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #339933;">&lt;?</span>xml version<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1.0&quot;</span> encoding<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;UTF-8&quot;</span><span style="color: #339933;">?&gt;</span><br />
<span style="color: #339933;">&lt;</span>jcr<span style="color: #339933;">:</span>root xmlns<span style="color: #339933;">:</span>sling<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://sling.apache.org/jcr/sling/1.0&quot;</span> xmlns<span style="color: #339933;">:</span>cq<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.day.com/jcr/cq/1.0&quot;</span> xmlns<span style="color: #339933;">:</span>jcr<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.jcp.org/jcr/1.0&quot;</span> xmlns<span style="color: #339933;">:</span>nt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.jcp.org/jcr/nt/1.0&quot;</span><br />
&nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; jcr<span style="color: #339933;">:</span>title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Common Field Granite UI Config for Content Components&quot;</span><br />
&nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;cq/gui/components/authoring/dialog&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>commonFields<br />
&nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/foundation/container&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>items jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>basicRTE<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;cq/gui/components/authoring/dialog/richtext&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>rtePlugins jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>format<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; features<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;*&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>links<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; features<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;*&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>rtePlugins<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>uiSettings jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>cui jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>inline<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; toolbar<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;[links#modifylink,links#unlink,format#bold,format#italic]&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>dialogFullScreen<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; toolbar<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;[links#modifylink,links#unlink,format#bold,format#italic]&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>cui<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>uiSettings<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>basicRTE<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>items<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>commonFields<span style="color: #339933;">&gt;</span><br />
<span style="color: #339933;">&lt;/</span>jcr<span style="color: #339933;">:</span>root<span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div>
<hr class="spacer-large"/>
<h3 id="include">3. From the targeted component, include the common Granite UI config</h3>
<p>/apps/sourcedcodeaem/components/content/announcement</p>
<div class="modernized-box">
<ul>
<li>line:32 &#8211; the standard, cq/gui/components/authoring/dialog/richtext, Granite UI component is being referred.</li>
<li>line:38 &#8211; inclusion of the common richtext &#8220;rtePlugins&#8221; configuration, /apps/sourcedcodeaem/components/dialogs/content/common/fields/cq:dialog/commonFields/items/basicRTE/rtePlugins</li>
<li>line:42 &#8211; inclusion of the common richtext &#8220;uiSettings&#8221; configuration, /apps/sourcedcodeaem/components/dialogs/content/common/fields/cq:dialog/commonFields/items/basicRTE/uiSettings</li>
</ul>
<p><b>Together with line:32,38,42 the common richtext component will be setup and ready to be used.</b>
</div>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #339933;">&lt;?</span>xml version<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1.0&quot;</span> encoding<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;UTF-8&quot;</span><span style="color: #339933;">?&gt;</span><br />
<span style="color: #339933;">&lt;</span>jcr<span style="color: #339933;">:</span>root xmlns<span style="color: #339933;">:</span>sling<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://sling.apache.org/jcr/sling/1.0&quot;</span> xmlns<span style="color: #339933;">:</span>cq<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.day.com/jcr/cq/1.0&quot;</span> xmlns<span style="color: #339933;">:</span>jcr<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.jcp.org/jcr/1.0&quot;</span> xmlns<span style="color: #339933;">:</span>nt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.jcp.org/jcr/nt/1.0&quot;</span><br />
&nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; jcr<span style="color: #339933;">:</span>title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Announcement Component&quot;</span><br />
&nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;cq/gui/components/authoring/dialog&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>content<br />
&nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/foundation/container&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>layout<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/foundation/layouts/tabs&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nav&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>items jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>text<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Hero Settings&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/foundation/section&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>layout<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/foundation/layouts/fixedcolumns&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; margin<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{Boolean}false&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>items jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>column<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/foundation/container&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>items jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>headerText<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/form/textfield&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldLabel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Title Text&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;./headerText&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>headingDescriptionText<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;cq/gui/components/authoring/dialog/richtext&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;./headingDescriptionText&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; required<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;true&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; useFixedInlineToolbar<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{Boolean}true&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>rtePlugins<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/include&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; path<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/apps/sourcedcodeaem/components/dialogs/content/common/fields/cq:dialog/commonFields/items/basicRTE/rtePlugins&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>uiSettings<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/include&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; path<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/apps/sourcedcodeaem/components/dialogs/content/common/fields/cq:dialog/commonFields/items/basicRTE/uiSettings&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>headingDescriptionText<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>items<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>column<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>items<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>text<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>items<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>content<span style="color: #339933;">&gt;</span><br />
<span style="color: #339933;">&lt;/</span>jcr<span style="color: #339933;">:</span>root<span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div>
<hr class="spacer-large"/>
<h3 id="done">4. Done</h3>
<p>Now we have successfully referenced an AEM component to the common Touch UI dialogue field.<br />
<a class="foobox" href="https://sourcedcode.com/wp-content/uploads/2021/06/granite-touch-ui-popup-richtext.png"><img loading="lazy" decoding="async" src="https://sourcedcode.com/wp-content/uploads/2021/06/granite-touch-ui-popup-richtext.png" alt="Announcement Component's Touch UI dialogue with a user interface of the common richtext configuration" width="920" height="543" class="aligncenter size-full wp-image-2859" srcset="https://sourcedcode.com/wp-content/uploads/2021/06/granite-touch-ui-popup-richtext.png 920w, https://sourcedcode.com/wp-content/uploads/2021/06/granite-touch-ui-popup-richtext-300x177.png 300w, https://sourcedcode.com/wp-content/uploads/2021/06/granite-touch-ui-popup-richtext-768x453.png 768w, https://sourcedcode.com/wp-content/uploads/2021/06/granite-touch-ui-popup-richtext-600x354.png 600w" sizes="(max-width: 920px) 100vw, 920px" /></a></p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/dry-way-of-using-richtext-granite-ui-component-in-aem-for-static-templates">DRY way of using RichText Granite UI Component in AEM for Static Templates</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/dry-way-of-using-richtext-granite-ui-component-in-aem-for-static-templates/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Re-usable Color Select in Touch UI Dialogs w/ ACS Common&#8217;s Generic Lists</title>
		<link>https://sourcedcode.com/blog/aem/re-usable-color-select-in-touch-ui-dialogs-w-acs-commons-generic-lists</link>
					<comments>https://sourcedcode.com/blog/aem/re-usable-color-select-in-touch-ui-dialogs-w-acs-commons-generic-lists#comments</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Fri, 19 Feb 2021 20:52:03 +0000</pubDate>
				<category><![CDATA[AEM]]></category>
		<category><![CDATA[Touch UI]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=2682</guid>

					<description><![CDATA[<p>While working on AEM component&#8217;s Touch UI dialogues, in particular, with colors, there are many cases where developers will need to configure the same color options over and over again. We catch ourselves repeating code, which becomes uneasy to maintain changes to the color options. What happens when there is a new color option? Going [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/re-usable-color-select-in-touch-ui-dialogs-w-acs-commons-generic-lists">Re-usable Color Select in Touch UI Dialogs w/ ACS Common&#8217;s Generic Lists</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>While working on AEM component&#8217;s Touch UI dialogues, in particular, with colors, there are many cases where developers will need to configure the same color options over and over again. We catch ourselves repeating code, which becomes uneasy to maintain changes to the color options. What happens when there is a new color option? Going through many files including a new color option is not that efficient. </p>
<p>In this article, we will be putting together a centralized configuration for color options that can be used by any Touch UI configuration throughout our AEM project utilizing the ACS Common&#8217;s Generic Lists. This tutorial will assume that you have your IDE opened, so you can copy and paste code to test.  </p>
<p><a href="https://sourcedcode.com/wp-content/uploads/2021/01/dropdown-generic-list.png"><img loading="lazy" decoding="async" src="https://sourcedcode.com/wp-content/uploads/2021/01/dropdown-generic-list-300x123.png" alt="Screenshot of completed tutorial, shows the generic list datasource" width="300" height="123" class="alignnone size-medium wp-image-2650" srcset="https://sourcedcode.com/wp-content/uploads/2021/01/dropdown-generic-list-300x123.png 300w, https://sourcedcode.com/wp-content/uploads/2021/01/dropdown-generic-list-1024x421.png 1024w, https://sourcedcode.com/wp-content/uploads/2021/01/dropdown-generic-list-768x316.png 768w, https://sourcedcode.com/wp-content/uploads/2021/01/dropdown-generic-list-600x247.png 600w, https://sourcedcode.com/wp-content/uploads/2021/01/dropdown-generic-list.png 1318w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<div class="mention-block">
<strong>Note!</strong><br />
This article was written specifically setting up centralized colors for Touch UI dialogues, but you can take this approach and apply it on any select granite UI with drop-down select options.
</div>
<hr class="spacer-large" />
<h2>What is ACS Commons Generic Lists?</H2><br />
Generic Lists are a feature allowing easy creation and management of lists of title/value pairs. This configuration can be used as a data source for Touch UI dialogues. </p>
<p>Content authors can amend and manage the list at any time, as long as they have permissions to /etc/acs-commons/lists/* they can make changes immediately. </p>
<p>When saving a selected value from the ACS Common&#8217;s Generic List datasource, the value will is copied and set in the components property. So you can imagine, the set value is not a reference but the value itself. </p>
<p><a href="https://sourcedcode.com/wp-content/uploads/2021/01/generic-list-vaue-saved-jcr-properties.png"><img loading="lazy" decoding="async" src="https://sourcedcode.com/wp-content/uploads/2021/01/generic-list-vaue-saved-jcr-properties-300x98.png" alt="CRX/DE show casing saved values are not references, but hard values" width="300" height="98" class="alignnone size-medium wp-image-2656" srcset="https://sourcedcode.com/wp-content/uploads/2021/01/generic-list-vaue-saved-jcr-properties-300x98.png 300w, https://sourcedcode.com/wp-content/uploads/2021/01/generic-list-vaue-saved-jcr-properties-768x251.png 768w, https://sourcedcode.com/wp-content/uploads/2021/01/generic-list-vaue-saved-jcr-properties-600x196.png 600w, https://sourcedcode.com/wp-content/uploads/2021/01/generic-list-vaue-saved-jcr-properties.png 911w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<hr class="spacer-large" />
<h2>Implementation</h2>
<p>In this part of the article, we will be going to step by step, creating a new generic list to hold our shared color options. Then we will set up our Touch UI component, and finally, show you how to amend the list in the author view. </p>
<div class="spacer-large"></div>
<h4>1. Create the ACS Commons Generic List</h4>
<p>Create a folder structure of /etc/acs-commons/lists/customcolors/.content.xml. Use the configuration as indicated below. Here you can see that we are creating a new page (ACS Common&#8217;s standards) with a parsys which is used to hold a collection of generic list items.<br />
<span class="code-highlight-primary">File: /etc/acs-commons/lists/customcolors/.content.xml</a></p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #339933;">&lt;?</span>xml version<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1.0&quot;</span> encoding<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;UTF-8&quot;</span><span style="color: #339933;">?&gt;</span><br />
<span style="color: #339933;">&lt;</span>jcr<span style="color: #339933;">:</span>root xmlns<span style="color: #339933;">:</span>sling<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://sling.apache.org/jcr/sling/1.0&quot;</span> xmlns<span style="color: #339933;">:</span>cq<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.day.com/jcr/cq/1.0&quot;</span> xmlns<span style="color: #339933;">:</span>jcr<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.jcp.org/jcr/1.0&quot;</span> xmlns<span style="color: #339933;">:</span>nt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.jcp.org/jcr/nt/1.0&quot;</span><br />
&nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;cq:Page&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>jcr<span style="color: #339933;">:</span>content<br />
&nbsp; &nbsp; &nbsp; &nbsp; cq<span style="color: #339933;">:</span>designPath<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/etc/designs/acs-commons&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; cq<span style="color: #339933;">:</span>template<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/apps/acs-commons/templates/utilities/genericlist&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;cq:PageContent&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;colours&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;acs-commons/components/utilities/genericlist&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>list<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;foundation/components/parsys&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>_000000<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Default&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;acs-commons/components/utilities/genericlist/item&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;000000&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>_0000FF<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Blue&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;acs-commons/components/utilities/genericlist/item&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;0000FF&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>_00ff00<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Green&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;acs-commons/components/utilities/genericlist/item&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;00ff00&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>_FF0000<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Red&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;acs-commons/components/utilities/genericlist/item&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;FF0000&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>list<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>jcr<span style="color: #339933;">:</span>content<span style="color: #339933;">&gt;</span><br />
<span style="color: #339933;">&lt;/</span>jcr<span style="color: #339933;">:</span>root<span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div>
<hr class="spacer-large" />
<h4>2. Insert the Granite UI snippet in the Touch UI Dialogue</h4>
<p>Once when ACS Commons Generic List is created, we use this code snippet to dynamically display all the options that will be available in the drop-down. In particular take a look at the <span class="code-highlight-primary">&lt;datasource&gt;</span>, as this is where all the magic happens. We are setting the path to the list that we have just created, while the sling:resourceType is acs-commons/components/utilities/genericlist/datasource.<br />
<strong>Snippet Example:</strong></p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #339933;">&lt;</span>textColor<br />
&nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/foundation/form/select&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; fieldLabel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Text Color&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;./textColor&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>datasource<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;acs-commons/components/utilities/genericlist/datasource&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; path<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/etc/acs-commons/lists/customcolors&quot;</span><span style="color: #339933;">/&gt;</span><br />
<span style="color: #339933;">&lt;/</span>textColor<span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div>
<p><strong>Touch UI Completed Example:</strong></p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #339933;">&lt;?</span>xml version<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1.0&quot;</span> encoding<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;UTF-8&quot;</span><span style="color: #339933;">?&gt;</span><br />
<span style="color: #339933;">&lt;</span>jcr<span style="color: #339933;">:</span>root xmlns<span style="color: #339933;">:</span>sling<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://sling.apache.org/jcr/sling/1.0&quot;</span> xmlns<span style="color: #339933;">:</span>cq<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.day.com/jcr/cq/1.0&quot;</span> xmlns<span style="color: #339933;">:</span>jcr<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.jcp.org/jcr/1.0&quot;</span> xmlns<span style="color: #339933;">:</span>nt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.jcp.org/jcr/nt/1.0&quot;</span><br />
&nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; jcr<span style="color: #339933;">:</span>title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Component Properties&quot;</span><br />
&nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;cq/gui/components/authoring/dialog&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>content<br />
&nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/fixedcolumns&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>items jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>column<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/container&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>items jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>text<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/coral/foundation/form/textfield&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldLabel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Text&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;./text&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>textColor<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;granite/ui/components/foundation/form/select&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldLabel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Text Color&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;./textColor&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>datasource<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jcr<span style="color: #339933;">:</span>primaryType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sling<span style="color: #339933;">:</span>resourceType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;acs-commons/components/utilities/genericlist/datasource&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; path<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/etc/acs-commons/lists/customcolors&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>textColor<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>items<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>column<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>items<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>content<span style="color: #339933;">&gt;</span><br />
<span style="color: #339933;">&lt;/</span>jcr<span style="color: #339933;">:</span>root<span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div>
<hr class="spacer-large" />
<h4>3. Include the Generic List in Filter in filter.xml</h4>
<p>Making sure that we have included the new configuration in our filters.xml, ensure the mode is set to &#8220;merge&#8221;, so that changes in the page will not be overwritten in the next release of the code. If you are on your development environment, you can build your code.</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #666666; font-style: italic;">//ui.apps/src/main/content/META-INF/vault/filter.xml</span><br />
<span style="color: #339933;">&lt;?</span>xml version<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1.0&quot;</span> encoding<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;UTF-8&quot;</span><span style="color: #339933;">?&gt;</span><br />
<span style="color: #339933;">&lt;</span>workspaceFilter version<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1.0&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>filter root<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/apps/sourcedcodeaem&quot;</span><span style="color: #339933;">/&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>filter root<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/etc/acs-commons/lists/customcolors&quot;</span> mode<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;merge&quot;</span><span style="color: #339933;">/&gt;</span><br />
<span style="color: #339933;">&lt;/</span>workspaceFilter<span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div>
<p>After your filter.xml have been updated, you can use your maven skills and <span class="code-highlight-primary">build your code to AEM</span>.</p>
<hr class="spacer-large" />
<h4>4. Test</h4>
<p>Once your code has been deployed, we are ready to test. Visit one of your content pages that have your <span class="code-highlight-primary">allowedComponent</span>, so we can test out the dialogue.<br />
In this example, while in edit mode, the Touch UI dialogue is indeed showing the options.<br />
<a href="https://sourcedcode.com/wp-content/uploads/2021/01/dropdown-generic-list.png"><img loading="lazy" decoding="async" src="https://sourcedcode.com/wp-content/uploads/2021/01/dropdown-generic-list-300x123.png" alt="Screenshot of the drop down options from the datasource" width="300" height="123" class="alignnone size-medium wp-image-2650" srcset="https://sourcedcode.com/wp-content/uploads/2021/01/dropdown-generic-list-300x123.png 300w, https://sourcedcode.com/wp-content/uploads/2021/01/dropdown-generic-list-1024x421.png 1024w, https://sourcedcode.com/wp-content/uploads/2021/01/dropdown-generic-list-768x316.png 768w, https://sourcedcode.com/wp-content/uploads/2021/01/dropdown-generic-list-600x247.png 600w, https://sourcedcode.com/wp-content/uploads/2021/01/dropdown-generic-list.png 1318w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>After making changes to the component, clicking on save will only save the value of the generic list, and not a reference.<br />
<a href="https://sourcedcode.com/wp-content/uploads/2021/01/generic-list-vaue-saved-jcr-properties.png"><img loading="lazy" decoding="async" src="https://sourcedcode.com/wp-content/uploads/2021/01/generic-list-vaue-saved-jcr-properties-300x98.png" alt="CRX/DE show casing saved values are not references, but hard values" width="300" height="98" class="alignnone size-medium wp-image-2656" srcset="https://sourcedcode.com/wp-content/uploads/2021/01/generic-list-vaue-saved-jcr-properties-300x98.png 300w, https://sourcedcode.com/wp-content/uploads/2021/01/generic-list-vaue-saved-jcr-properties-768x251.png 768w, https://sourcedcode.com/wp-content/uploads/2021/01/generic-list-vaue-saved-jcr-properties-600x196.png 600w, https://sourcedcode.com/wp-content/uploads/2021/01/generic-list-vaue-saved-jcr-properties.png 911w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<hr class="spacer-large" />
<h4>5. Amend the List as an Author</h4>
<p>Making changes to the list is simple, head to the ACS Common&#8217;s Generic Lists console: <a href="http://localhost:4502/generic-lists.html/etc/acs-commons/lists" rel="noopener" target="_blank">http://localhost:4502/generic-lists.html/etc/acs-commons/lists</a>, select on your list, and click on properties. The link should take you to <a href="http://localhost:4502/mnt/overlay/acs-commons/components/utilities/genericlist.html?item=/etc/acs-commons/lists/customcolors" rel="noopener" target="_blank">http://localhost:4502/mnt/overlay/acs-commons/components/utilities/genericlist.html?item=/etc/acs-commons/lists/customcolors</a>.</p>
<p>Here, as an example, we will add a new option named a Demo Test &#8211; White, with the value of FFFFFF.<br />
<a href="https://sourcedcode.com/wp-content/uploads/2021/01/generic-list-properties-options-button.png"><img loading="lazy" decoding="async" src="https://sourcedcode.com/wp-content/uploads/2021/01/generic-list-properties-options-button-300x257.png" alt="ACS Common’s Generic Lists editing a list item" width="300" height="257" class="alignnone size-medium wp-image-2664" srcset="https://sourcedcode.com/wp-content/uploads/2021/01/generic-list-properties-options-button-300x257.png 300w, https://sourcedcode.com/wp-content/uploads/2021/01/generic-list-properties-options-button-1024x878.png 1024w, https://sourcedcode.com/wp-content/uploads/2021/01/generic-list-properties-options-button-768x658.png 768w, https://sourcedcode.com/wp-content/uploads/2021/01/generic-list-properties-options-button-600x514.png 600w, https://sourcedcode.com/wp-content/uploads/2021/01/generic-list-properties-options-button.png 1240w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>We just need to save and close, publish is not required, only because we are using the generic list as a datasource for our Touch UI dialoges.</p>
<hr class="spacer-large" />
<h4>6. Done</h4>
<p>After saving the new Generic List&#8217;s configuration we can go back to the Touch UI editor, and here revealed is the new option.<br />
<a href="https://sourcedcode.com/wp-content/uploads/2021/01/generic-list-options-shown.png"><img loading="lazy" decoding="async" src="https://sourcedcode.com/wp-content/uploads/2021/01/generic-list-options-shown-300x133.png" alt="Screenshot of completed tutorial, shows the generic list datasource" width="300" height="133" class="alignnone size-medium wp-image-2665" srcset="https://sourcedcode.com/wp-content/uploads/2021/01/generic-list-options-shown-300x133.png 300w, https://sourcedcode.com/wp-content/uploads/2021/01/generic-list-options-shown-1024x453.png 1024w, https://sourcedcode.com/wp-content/uploads/2021/01/generic-list-options-shown-768x340.png 768w, https://sourcedcode.com/wp-content/uploads/2021/01/generic-list-options-shown-600x266.png 600w, https://sourcedcode.com/wp-content/uploads/2021/01/generic-list-options-shown.png 1240w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<div class="spacer-large"></div>
<h2>In Summary</h2>
<p>Definitely, this approach is a production-ready approach and is recommended if you have repetitive list options in your components. This implementation will really reduce your configuration overhead in the long run. I hope you enjoyed this tutorial.</p>
<p>The tutorial in this article is highly coupled to a developer, where the generic list is created from the code, but if you wish yo learn how to create a generic list from the AEM platform&#8217;s UI or more details about this tool visit the ACS Common&#8217;s Generic List&#8217;s release notes page, <a href="https://adobe-consulting-services.github.io/acs-aem-commons/features/generic-lists/index.html" rel="noopener" target="_blank">click here</a>. </p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/re-usable-color-select-in-touch-ui-dialogs-w-acs-commons-generic-lists">Re-usable Color Select in Touch UI Dialogs w/ ACS Common&#8217;s Generic Lists</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/re-usable-color-select-in-touch-ui-dialogs-w-acs-commons-generic-lists/feed</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
		<item>
		<title>AEM RichText Max Characters Length Validation</title>
		<link>https://sourcedcode.com/blog/aem/touch-ui/aem-richtext-max-characters-length-validation</link>
					<comments>https://sourcedcode.com/blog/aem/touch-ui/aem-richtext-max-characters-length-validation#respond</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Sun, 02 Aug 2020 15:26:48 +0000</pubDate>
				<category><![CDATA[Touch UI]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=2123</guid>

					<description><![CDATA[<p>In this article, we will take a look at how we can add max character length validation to the richtext component, cq/gui/components/authoring/dialog/richtext, by introducing a maxlength attribute. The validation will be executed whenever AEM authors try to save or perform an on-key-up action after applying changes within the richtext input field. After implementing the solution, [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/touch-ui/aem-richtext-max-characters-length-validation">AEM RichText Max Characters Length Validation</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In this article, we will take a look at how we can add max character length validation to the richtext component, cq/gui/components/authoring/dialog/richtext, by introducing a <span class="code-highlight-primary">maxlength</span> attribute. The validation will be executed whenever AEM authors try to save or perform an on-key-up action after applying changes within the richtext input field. After implementing the solution, all richtext components within the installed AEM author environment will have this feature enabled.</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">// to enable the max character limit, simply include the <span style="color: #ff0000;">&quot;maxlength&quot;</span> attribute<br />
<span style="color: #000000; font-weight: bold;">&lt;description</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;cq/gui/components/authoring/dialog/richtext&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;Description (max 100 chars)&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./description&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">useFixedInlineToolbar</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">maxlength</span>=<span style="color: #ff0000;">&quot;100&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; ...<br />
<span style="color: #000000; font-weight: bold;">&lt;/description<span style="color: #000000; font-weight: bold;">&gt;</span></span></div></td></tr></tbody></table></div>
<p>We will be solving this problem by registering a new validator (foundation.validation.validator) to the foundation-registry (the foundation-registry is used in the Granite UI framework). In this solution we will be utilising the <a href="https://jqueryvalidation.org/" rel="noopener noreferrer" target="_blank">jQuery Validation library</a> (the validation library used by <a href="https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/foundation/clientlibs/foundation/js/validation/index.html" rel="noopener noreferrer" target="_blank">Granite UI is achieved by using jQuery Validation plugin</a>). <span class="code-highlight-primary">A new client library</a> will be introduced to inject JavaScript into our context page, and to execute the registry and scripts.</p>
<hr class="spacer-large"/>
<h2>Steps for Enabling RichText Max Characters Validation</h2>
<h3>Step 1. Client Library</h4>
<p><a class="foobox" href="https://sourcedcode.com/wp-content/uploads/2020/08/max-characters-limit-configuration.png"><img loading="lazy" decoding="async" src="https://sourcedcode.com/wp-content/uploads/2020/08/max-characters-limit-configuration.png" alt="Client Library programmatic setup" width="1327" height="103" class="alignnone size-full wp-image-2167" srcset="https://sourcedcode.com/wp-content/uploads/2020/08/max-characters-limit-configuration.png 1327w, https://sourcedcode.com/wp-content/uploads/2020/08/max-characters-limit-configuration-300x23.png 300w, https://sourcedcode.com/wp-content/uploads/2020/08/max-characters-limit-configuration-1024x79.png 1024w, https://sourcedcode.com/wp-content/uploads/2020/08/max-characters-limit-configuration-768x60.png 768w, https://sourcedcode.com/wp-content/uploads/2020/08/max-characters-limit-configuration-600x47.png 600w" sizes="(max-width: 1327px) 100vw, 1327px" /></a></p>
<h6>1.1 Create a new client library with the XML configurations below:</h6>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<span style="color: #000000; font-weight: bold;">&lt;jcr:root</span> <span style="color: #000066;">xmlns:cq</span>=<span style="color: #ff0000;">&quot;http://www.day.com/jcr/cq/1.0&quot;</span> <span style="color: #000066;">xmlns:jcr</span>=<span style="color: #ff0000;">&quot;http://www.jcp.org/jcr/1.0&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;cq:ClientLibraryFolder&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">allowProxy</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">categories</span>=<span style="color: #ff0000;">&quot;[cq.authoring.editor.hook]&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">dependencies</span>=<span style="color: #ff0000;">&quot;[cq.authoring.editor.core]&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></div></td></tr></tbody></table></div>
<div class="spacer-large"></div>
<h6>1.2 Configure the client libraries js.txt</h6>
<p>Create a js.txt file in the client library with the body content below:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">#<span style="color: #000066;">base</span>=js<br />
richtext-maxwidth-validation.js</div></td></tr></tbody></table></div>
<div class="spacer-large"></div>
<h6>1.3 Register the new Validator with Javascript</h6>
<p>Create create a folder named js, and under that, create the richtext-maxwidth-validation.js file with the script below:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #339933;">;</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>window<span style="color: #339933;">,</span> $<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #3366CC;">'use strict'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">/**<br />
&nbsp; &nbsp; * Rich-Text Editor Max Length Validation<br />
&nbsp; &nbsp; *<br />
&nbsp; &nbsp; * @class RichTextMaxLengthValidation<br />
&nbsp; &nbsp; * @classdesc registers a new validator to the foundation-registry service focused on the<br />
&nbsp; &nbsp; * cq/gui/components/authoring/dialog/richtext component.<br />
&nbsp; &nbsp; *<br />
&nbsp; &nbsp; * Usage: the attribute maxlength to the richtext component, example: maxlength=&quot;100&quot;<br />
&nbsp; &nbsp; */</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> RichTextMaxLengthValidation<span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> CONST <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TARGET_GRANITE_UI<span style="color: #339933;">:</span> <span style="color: #3366CC;">'.coral-RichText-editable'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ERROR_MESSAGE<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Your text length is {0} but character limit is {1}!'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* Initializes the RichTextMaxLengthValidation<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">function</span> init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// register the validator which includes the validate algorithm</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">adaptTo</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'foundation-registry'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">register</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'foundation.validation.validator'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; selector<span style="color: #339933;">:</span> CONST.<span style="color: #660066;">TARGET_GRANITE_UI</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; validate<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>el<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> $rteField <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>el<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> $field <span style="color: #339933;">=</span> $rteField.<span style="color: #660066;">closest</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.richtext-container'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input.coral-Form-field'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> maxLength <span style="color: #339933;">=</span> $field.<span style="color: #660066;">data</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'maxlength'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> textLength <span style="color: #339933;">=</span> $rteField.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>maxLength <span style="color: #339933;">&amp;&amp;</span> textLength <span style="color: #339933;">&gt;</span> maxLength<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> Granite.<span style="color: #660066;">I18n</span>.<span style="color: #000066; font-weight: bold;">get</span><span style="color: #009900;">&#40;</span>CONST.<span style="color: #660066;">ERROR_MESSAGE</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#91;</span>textLength<span style="color: #339933;">,</span> maxLength<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// execute Jquery Validation onKeyUp</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">on</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'keyup'</span><span style="color: #339933;">,</span> CONST.<span style="color: #660066;">TARGET_GRANITE_UI</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; executeJqueryValidation<span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* Execute foundation.validation.validator's validate algorithm.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">function</span> executeJqueryValidation<span style="color: #009900;">&#40;</span>el<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">var</span> validationApi <span style="color: #339933;">=</span> el.<span style="color: #660066;">adaptTo</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'foundation-validation'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>validationApi<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; validationApi.<span style="color: #660066;">checkValidity</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; validationApi.<span style="color: #660066;">updateUI</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; init<span style="color: #339933;">:</span> init<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; RichTextMaxLengthValidation.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>window<span style="color: #339933;">,</span> Granite.$<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<hr class="spacer-large"/>
<h3>Step 2. Include the maxlength Attribute</h4>
<p>Within the Granite UI XML configure configuration, add the &#8220;maxlength&#8221; attribute, example: maxlength=&#8221;100&#8243;.</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;jcr:root</span> <span style="color: #000066;">xmlns:sling</span>=<span style="color: #ff0000;">&quot;http://sling.apache.org/jcr/sling/1.0&quot;</span> <span style="color: #000066;">xmlns:cq</span>=<span style="color: #ff0000;">&quot;http://www.day.com/jcr/cq/1.0&quot;</span> <span style="color: #000066;">xmlns:jcr</span>=<span style="color: #ff0000;">&quot;http://www.jcp.org/jcr/1.0&quot;</span> <span style="color: #000066;">xmlns:nt</span>=<span style="color: #ff0000;">&quot;http://www.jcp.org/jcr/nt/1.0&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">jcr:title</span>=<span style="color: #ff0000;">&quot;RichText Max Characters&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;cq/gui/components/authoring/dialog&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;content</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/foundation/container&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;items</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;descriptionText1</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;cq/gui/components/authoring/dialog/richtext&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;Description (max 100 chars)&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">maxlength</span>=<span style="color: #ff0000;">&quot;100&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./description&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">useFixedInlineToolbar</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rtePlugins</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;formats</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">features</span>=<span style="color: #ff0000;">&quot;*&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;links</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">features</span>=<span style="color: #ff0000;">&quot;*&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rtePlugins<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;uiSettings</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;cui</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;inline</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">toolbar</span>=<span style="color: #ff0000;">&quot;[links#modifylink,links#unlink,format#bold,format#italic]&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dialogFullScreen</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">toolbar</span>=<span style="color: #ff0000;">&quot;[links#modifylink,links#unlink,format#bold,format#italic]&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/cui<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/uiSettings<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/descriptionText1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/items<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/content<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/jcr:root<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<hr class="spacer-large"/>
<h3>Step 3. Done</h4>
<p>When an AEM author exceeds the maximum character limit, the richtext component will display a default Granite UI error icon. Clicking on the error icon will display the error message, which the error message is configured in the JavaScript logic. Validation for the maximum character limit will be executed whenever an AEM author tries to save the form or during a keypress up event.<br />
<strong>Result:</strong><br />
<a href="https://sourcedcode.com/wp-content/uploads/2020/08/max-characters-limit-example.png" class="foobox"><img decoding="async" src="https://sourcedcode.com/wp-content/uploads/2020/08/max-characters-limit-example.png" alt="Touch UI dialogue - Rich Text max-character-limit result"/></a></p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/touch-ui/aem-richtext-max-characters-length-validation">AEM RichText Max Characters Length Validation</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/touch-ui/aem-richtext-max-characters-length-validation/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Creating a Basic AEM Touch UI Dialogue</title>
		<link>https://sourcedcode.com/blog/aem/creating-a-basic-aem-touch-ui-dialogue</link>
					<comments>https://sourcedcode.com/blog/aem/creating-a-basic-aem-touch-ui-dialogue#respond</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Sun, 24 May 2020 15:24:16 +0000</pubDate>
				<category><![CDATA[AEM]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Touch UI]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=1507</guid>

					<description><![CDATA[<p>In this article, we will step through the steps of creating a new Touch UI dialogue configuration within your AEM maven project. Code examples will showcase a basic Granite UI form container &#038; component. Create basic Touch UI Dialogue Within your AEM maven source code, create create a &#8220;_cq_dialogue&#8221; folder under your targeted component. Example: [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/creating-a-basic-aem-touch-ui-dialogue">Creating a Basic AEM Touch UI Dialogue</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In this article, we will step through the steps of creating a new Touch UI dialogue configuration within your AEM maven project. Code examples will showcase a basic Granite UI form container &#038; component.</p>
<h4>Create basic Touch UI Dialogue</h4>
<ol>
<li>Within your AEM maven source code, create create a &#8220;_cq_dialogue&#8221; folder under your targeted component. Example: <span class="code-highlight-black">/apps/weretail/components/content/text</span>.<br />
<strong>Result</strong>: /apps/weretail/components/content/text/_cq_dialogue, <a target="_blank" href="https://sourcedcode.com/wp-content/uploads/2020/05/article-img__cq_dialogue-folder.png" rel="noopener noreferrer"><img decoding="async" src="https://sourcedcode.com/wp-content/uploads/2020/05/article-img__cq_dialogue-folder.png" alt="_cq_dialogue folder" width="280" /></a>.</li>
<li>Within the _cq_dialogue, create a .content.xml file: <a target="_blank" href="https://sourcedcode.com/wp-content/uploads/2020/05/article-img__cq_dialogue-xmlfile.png" rel="noopener noreferrer"><img decoding="async" src="https://sourcedcode.com/wp-content/uploads/2020/05/article-img__cq_dialogue-xmlfile.png" alt="_cq_dialogue .context.xml file" width="280"/></a>.</li>
<li>Now lets paste in the basic Touch UI XML structure into the .content.xml file as:
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<span style="color: #000000; font-weight: bold;">&lt;jcr:root</span> <span style="color: #000066;">xmlns:sling</span>=<span style="color: #ff0000;">&quot;http://sling.apache.org/jcr/sling/1.0&quot;</span> <span style="color: #000066;">xmlns:granite</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/jcr/granite/1.0&quot;</span> <span style="color: #000066;">xmlns:cq</span>=<span style="color: #ff0000;">&quot;http://www.day.com/jcr/cq/1.0&quot;</span> <span style="color: #000066;">xmlns:jcr</span>=<span style="color: #ff0000;">&quot;http://www.jcp.org/jcr/1.0&quot;</span> <span style="color: #000066;">xmlns:nt</span>=<span style="color: #ff0000;">&quot;http://www.jcp.org/jcr/nt/1.0&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:title</span>=<span style="color: #ff0000;">&quot;Granite UI Converting to XML, Example&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;cq/gui/components/authoring/dialog&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;content</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/foundation/container&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;items</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;!--<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ... insert Granite UI form components here.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --<span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/items<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/content<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<span style="color: #000000; font-weight: bold;">&lt;/jcr:root<span style="color: #000000; font-weight: bold;">&gt;</span></span></div></td></tr></tbody></table></div>
<li>Use your maven skills, and build your code into AEM.</li>
</li>
<li>When we open the Touch UI dialogue, the Touch UI container should remain <span class="code-highlight-primary">empty</span>, and should look something like this:<br />
<a target="_blank" href="https://sourcedcode.com/wp-content/uploads/2020/05/article-img-granit-ui-example-no-form-component.png" rel="noopener noreferrer"><img decoding="async" src="https://sourcedcode.com/wp-content/uploads/2020/05/article-img-granit-ui-example-no-form-component.png" alt="granit-ui-example-no-form-component" width="280"/></a></li>
<li>Now lets include the textfield component into the Touch UI dialogue container:
<div class="mention-block">
To learn how to write your own XML formatted Granite UI 1.0 form components, check out <a href="https://sourcedcode.com/blog/aem/how-to-convert-adobes-granite-ui-1-0-documentation-to-xml" target="_blank" rel="noopener noreferrer">this article</a>.
</div>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<span style="color: #000000; font-weight: bold;">&lt;jcr:root</span> <span style="color: #000066;">xmlns:sling</span>=<span style="color: #ff0000;">&quot;http://sling.apache.org/jcr/sling/1.0&quot;</span> <span style="color: #000066;">xmlns:granite</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/jcr/granite/1.0&quot;</span> <span style="color: #000066;">xmlns:cq</span>=<span style="color: #ff0000;">&quot;http://www.day.com/jcr/cq/1.0&quot;</span> <span style="color: #000066;">xmlns:jcr</span>=<span style="color: #ff0000;">&quot;http://www.jcp.org/jcr/1.0&quot;</span> <span style="color: #000066;">xmlns:nt</span>=<span style="color: #ff0000;">&quot;http://www.jcp.org/jcr/nt/1.0&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:title</span>=<span style="color: #ff0000;">&quot;Granite UI Converting to XML, Example&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;cq/gui/components/authoring/dialog&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;content</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/foundation/container&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;items</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;labelTextfield</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/textfield&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;Label: labelTextfield&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./labelTextfield&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;{String}Default Text&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">emptyText</span>=<span style="color: #ff0000;">&quot;Show placeholder text when input field is empty.&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">disabled</span>=<span style="color: #ff0000;">&quot;{Boolean}false&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">required</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">autocomplete</span>=<span style="color: #ff0000;">&quot;off&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">autofocus</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">validation</span>=<span style="color: #ff0000;">&quot;&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">maxlength</span>=<span style="color: #ff0000;">&quot;{Long}100&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/items<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/content<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<span style="color: #000000; font-weight: bold;">&lt;/jcr:root<span style="color: #000000; font-weight: bold;">&gt;</span></span></div></td></tr></tbody></table></div>
</li>
<li>Use your maven skills, and build your code into AEM.</li>
<li>
<strong>final result</strong>:<br />
<a target="_blank" href="https://sourcedcode.com/wp-content/uploads/2020/05/article-img-granit-ui-example-ss.png" rel="noopener noreferrer"><img decoding="async" src="https://sourcedcode.com/wp-content/uploads/2020/05/article-img-granit-ui-example-ss.png" alt="granite UI completed example" width="300"/></a>
</li>
</ol>
<div class="mention-block">
<strong>Learn More:</strong><br />
To learn how to write your own XML formatted Granite UI 1.0 form components, check out <a href="https://sourcedcode.com/blog/aem/how-to-convert-adobes-granite-ui-1-0-documentation-to-xml" target="_blank" rel="noopener noreferrer">this article</a>.</p>
<p><strong>Pro Tip:</strong> Have the <a href="https://sourcedcode.com/blog/aem/aem-granite-ui-1-0-form-components-xml-reference-guide#granite-ui-colorpicker" rel="noopener noreferrer" target="_blank">AEM Granite UI 1.0 Form Component’s XML Reference Guide</a> opened in another tab, and accessible during development of Touch UI dialogues.
</div>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/creating-a-basic-aem-touch-ui-dialogue">Creating a Basic AEM Touch UI Dialogue</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/creating-a-basic-aem-touch-ui-dialogue/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Convert Adobe’s Granite UI 1.0 Documentation to XML</title>
		<link>https://sourcedcode.com/blog/aem/how-to-convert-adobes-granite-ui-1-0-documentation-to-xml</link>
					<comments>https://sourcedcode.com/blog/aem/how-to-convert-adobes-granite-ui-1-0-documentation-to-xml#respond</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Sun, 24 May 2020 14:06:34 +0000</pubDate>
				<category><![CDATA[AEM]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Touch UI]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=1442</guid>

					<description><![CDATA[<p>As an AEM developer, we must prepare Touch UI dialogues within code, in the XML format. When it comes to reading the Granite UI 1.0 Documentation, it can be confusing; especially for new AEM developers. These new AEM developers are confused by how properties within the documentation are mapped and converted to XML entries. This [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/how-to-convert-adobes-granite-ui-1-0-documentation-to-xml">How to Convert Adobe’s Granite UI 1.0 Documentation to XML</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>As an AEM developer, we must prepare Touch UI dialogues within code, in the XML format. When it comes to reading the Granite UI 1.0 Documentation, it can be confusing; especially for new AEM developers. These new AEM developers are confused by how properties within the documentation are mapped and converted to XML entries.</p>
<p>This document will help you understand how properties within the <a href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/index.html" target="_blank" rel="noopener noreferrer">Granite UI 1.0 documentation</a> are mapped and converted to XML entries.</p>
<div class="mention-block">This article will focus on how to convert the Granite UI <strong>textfield component</strong> documentation to XML format.</div>
<p><strong>Quick Links:</strong></p>
<ol>
<li><a href="#understanding-granite-ui-docs">Understanding the Adobe’s Granite UI 1.0 Documentation</a></li>
<li><a href="#question-hierarchy-examples">Question: Example Hierarchy Explained</a></li>
<li><a href="#conclusion">Conclusion</a></li>
</ol>
<hr class="spacer-large" />
<h2 id="understanding-granite-ui-docs">Understanding the Adobe’s Granite UI 1.0 Documentation, textfield component:</h2>
<p>Before we jump straight to the code examples, let us understand how to convert Adobe&#8217;s Granite UI 1.0 Documentation to XML. When looking at an Granite UI 1.0 form component&#8217;s documentation, <strong>textfield component</strong>, we are presented with <a href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/textfield/index.html" target="_blank" rel="noopener nofollow noreferrer">this</a> page:<br />
<a href="https://sourcedcode.com/wp-content/uploads/2020/05/how-to-read-granite-ui-forms-documentation-details-scaled.jpg"><img decoding="async" src="https://sourcedcode.com/wp-content/uploads/2020/05/how-to-read-granite-ui-forms-documentation-details-scaled.jpg" alt="" width="100%" /></a><strong>We can see a couple of sections of the page:</strong></p>
<ul>
<li>The component&#8217;s sling:resourceType reference.</li>
<li>The details &amp; description about the current form component. From what we can see, the textfield form element extends from the <a href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/field/index.html#/libs/granite/ui/components/coral/foundation/form/field" target="_blank" rel="noopener noreferrer">Field</a>, abstract component; extended <a href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/field/index.html#/libs/granite/ui/components/coral/foundation/form/field" target="_blank" rel="noopener noreferrer">Field</a> component also makes more property configuration available to the form component.</li>
<li>The available configuration and properties for the form component.</li>
</ul>
<h3>a. Create a New textfield Component:</h3>
<p>Once we understand the configurations and properties for the textfield form component, with XML, we can create a textfield component with the following. Note that the sling resource has a primary type of <span class="code-highlight-black">jcr:primaryType=&#8221;nt:unstructured&#8221;</span>, as follows:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">&lt;labelTextfield</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/textfield&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></div></td></tr></tbody></table></div>
<h3>b. Plug in the Necessary Properties to our textfield Form Component:</h3>
<p>Next, using the Granite UI 1.0 documentation, we can simply plug in the necessary properties to our form component, sling resource.<br />
<a href="https://sourcedcode.com/wp-content/uploads/2020/05/how-to-read-granite-ui-forms-documentation-diagram.jpg" target="_blank" rel="noopener noreferrer"><img decoding="async" src="https://sourcedcode.com/wp-content/uploads/2020/05/how-to-read-granite-ui-forms-documentation-diagram.jpg" alt="granite UI form components mapping" width="50%" /></a></p>
<p>Based on our requirements, we can copy properties from the Granite UI 1.0 documentation into our newly created component, within the XML:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">&lt;labelTextfield</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/textfield&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;Label: labelTextfield&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./labelTextfield&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;{String}Default Text&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">emptyText</span>=<span style="color: #ff0000;">&quot;Show placeholder text when input field is empty.&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">disabled</span>=<span style="color: #ff0000;">&quot;{Boolean}false&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">required</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">autocomplete</span>=<span style="color: #ff0000;">&quot;off&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">autofocus</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">validation</span>=<span style="color: #ff0000;">&quot;&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">maxlength</span>=<span style="color: #ff0000;">&quot;{Long}100&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></div></td></tr></tbody></table></div>
<div class="mention-block">
<strong>Note:</strong><br />
To learn how to Creating a Basic AEM Touch UI Dialogue, check out <a href="/blog/aem/creating-a-basic-aem-touch-ui-dialogue" target="_blank" rel="noopener noreferrer">this article</a>.
</div>
<hr class="spacer-large"/>
<h3 id="question-hierarchy-examples">Question: Example Hierarchy Explained</h3>
<p>q: How can translate hierarchy examples diagrams within the Granite UI 1.0 Documentation?<br />
Example in such diagrams:<br />
<a target="_blank" href="https://sourcedcode.com/wp-content/uploads/2020/05/article-img-hierarchical-example.png" rel="noopener noreferrer"><img decoding="async" src="https://sourcedcode.com/wp-content/uploads/2020/05/article-img-hierarchical-example.png" alt="" width="100%"/></a><br />
Translated XML, looks like:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">&lt;color</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/colorfield&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./color&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;items</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;color1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;#FF4136&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;color2</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;#0077D9&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/items<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<span style="color: #000000; font-weight: bold;">&lt;/color<span style="color: #000000; font-weight: bold;">&gt;</span></span></div></td></tr></tbody></table></div>
<hr class="spacer-large"/>
<h2 id="conclusion">Conclusion</h2>
<p>I hope this article has been helpful. Other than the Granite UI 1.0 Text Field form component. There are many other form components you would be using based on your requirements. Have a play with all the form components available in the Granite UI 1.0 library. They are listed here:</p>
<p>Components:</p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/actionfield/index.html" target="_blank" rel="nofollow noopener noreferrer">ActionField</a></li>
<li class="toctree-l1"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/advancedselect/index.html" target="_blank" rel="nofollow noopener noreferrer">AdvancedSelect</a>
<ul>
<li class="toctree-l2"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/advancedselect/status/index.html" target="_blank" rel="nofollow noopener noreferrer">AdvancedSelectStatus</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/autocomplete/index.html" target="_blank" rel="nofollow noopener noreferrer">Autocomplete</a>
<ul>
<li class="toctree-l2"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/autocomplete/list/index.html" target="_blank" rel="nofollow noopener noreferrer">AutocompleteList</a></li>
<li class="toctree-l2"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/autocomplete/tags/index.html" target="_blank" rel="nofollow noopener noreferrer">AutocompleteTags</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/buttongroup/index.html" target="_blank" rel="nofollow noopener noreferrer">ButtonGroup</a></li>
<li class="toctree-l1"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/checkbox/index.html" target="_blank" rel="nofollow noopener noreferrer">Checkbox</a></li>
<li class="toctree-l1"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/colorfield/index.html" target="_blank" rel="nofollow noopener noreferrer">ColorField</a></li>
<li class="toctree-l1"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/datepicker/index.html" target="_blank" rel="nofollow noopener noreferrer">DatePicker</a></li>
<li class="toctree-l1"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/field/index.html" target="_blank" rel="nofollow noopener noreferrer">Field</a></li>
<li class="toctree-l1"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/fieldset/index.html" target="_blank" rel="nofollow noopener noreferrer">FieldSet</a></li>
<li class="toctree-l1"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/fileupload/index.html" target="_blank" rel="nofollow noopener noreferrer">FileUpload</a></li>
<li class="toctree-l1"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/hidden/index.html" target="_blank" rel="nofollow noopener noreferrer">Hidden</a></li>
<li class="toctree-l1"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/multifield/index.html" target="_blank" rel="nofollow noopener noreferrer">Multifield</a>
<ul>
<li class="toctree-l2"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/multifield/index.html#examples" target="_blank" rel="nofollow noopener noreferrer">Examples</a>
<ul>
<li class="toctree-l3"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/multifield/index.html#textfield" target="_blank" rel="nofollow noopener noreferrer">TextField</a></li>
<li class="toctree-l3"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/multifield/index.html#fileupload" target="_blank" rel="nofollow noopener noreferrer">FileUpload</a></li>
<li class="toctree-l3"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/multifield/index.html#fieldset" target="_blank" rel="nofollow noopener noreferrer">FieldSet</a></li>
<li class="toctree-l3"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/multifield/index.html#multifield-nesting-another-multifield" target="_blank" rel="nofollow noopener noreferrer">Multifield Nesting Another Multifield</a></li>
<li class="toctree-l3"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/multifield/index.html#pathfield-and-rte-rich-text-editor" target="_blank" rel="nofollow noopener noreferrer">PathField and RTE (Rich Text Editor)</a></li>
<li class="toctree-l3"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/multifield/index.html#radiogroup" target="_blank" rel="nofollow noopener noreferrer">RadioGroup</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/nestedcheckboxlist/index.html" target="_blank" rel="nofollow noopener noreferrer">NestedCheckboxList</a></li>
<li class="toctree-l1"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/numberfield/index.html" target="_blank" rel="nofollow noopener noreferrer">NumberField</a></li>
<li class="toctree-l1"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/password/index.html" target="_blank" rel="nofollow noopener noreferrer">Password</a></li>
<li class="toctree-l1"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/pathfield/index.html" target="_blank" rel="nofollow noopener noreferrer">PathField</a></li>
<li class="toctree-l1"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/radiogroup/index.html" target="_blank" rel="nofollow noopener noreferrer">RadioGroup</a></li>
<li class="toctree-l1"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/responses/index.html" target="_blank" rel="nofollow noopener noreferrer">Responses</a>
<ul>
<li class="toctree-l2"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/responses/openprompt/index.html" target="_blank" rel="nofollow noopener noreferrer">OpenPrompt</a></li>
<li class="toctree-l2"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/responses/redirect/index.html" target="_blank" rel="nofollow noopener noreferrer">Redirect</a></li>
<li class="toctree-l2"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/responses/reload/index.html" target="_blank" rel="nofollow noopener noreferrer">Reload</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/select/index.html" target="_blank" rel="nofollow noopener noreferrer">Select</a></li>
<li class="toctree-l1"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/switch/index.html" target="_blank" rel="nofollow noopener noreferrer">Switch</a></li>
<li class="toctree-l1"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/textarea/index.html" target="_blank" rel="nofollow noopener noreferrer">Textarea</a></li>
<li class="toctree-l1"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/textfield/index.html" target="_blank" rel="nofollow noopener noreferrer">TextField</a></li>
<li class="toctree-l1"><a class="reference internal" href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/userpicker/index.html" target="_blank" rel="nofollow noopener noreferrer">UserPicker</a></li>
</ul>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper"></div>
</div>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/how-to-convert-adobes-granite-ui-1-0-documentation-to-xml">How to Convert Adobe’s Granite UI 1.0 Documentation to XML</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/how-to-convert-adobes-granite-ui-1-0-documentation-to-xml/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>AEM Granite UI 1.0 Form Component&#8217;s XML Cheat Sheet Reference Guide</title>
		<link>https://sourcedcode.com/blog/aem/aem-granite-ui-1-0-form-components-xml-cheat-sheet-reference-guide</link>
					<comments>https://sourcedcode.com/blog/aem/aem-granite-ui-1-0-form-components-xml-cheat-sheet-reference-guide#comments</comments>
		
		<dc:creator><![CDATA[briankasingli]]></dc:creator>
		<pubDate>Sun, 24 May 2020 12:57:12 +0000</pubDate>
				<category><![CDATA[AEM]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Quick Reference]]></category>
		<category><![CDATA[Touch UI]]></category>
		<guid isPermaLink="false">https://sourcedcode.com/?p=1418</guid>

					<description><![CDATA[<p>This AEM Granite UI 1.0 Form Component&#8217;s XML Reference Guide provides code snippets to help developers speed up their AEM Touch UI development. This quick reference includes the most used Granite UI form components with plug and plays XML examples. Note: If you want to understand how to convert Granite UI 1.0 Form Components from [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/aem-granite-ui-1-0-form-components-xml-cheat-sheet-reference-guide">AEM Granite UI 1.0 Form Component&#8217;s XML Cheat Sheet Reference Guide</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This AEM Granite UI 1.0 Form Component&#8217;s XML Reference Guide provides code snippets to help developers speed up their AEM Touch UI development. This quick reference includes the most used Granite UI form components with plug and plays XML examples.</p>
<div class="mention-block">
<strong>Note:</strong><br />
If you want to understand how to convert Granite UI 1.0 Form Components from Adobe&#8217;s documentation to XML format, have a look at <a href="https://sourcedcode.com/blog/aem/how-to-convert-adobes-granite-ui-1-0-documentation-to-xml" title="How to convert Adobe’s Granite UI 1.0 Documentation to XML" rel="noopener noreferrer" target="_blank">article</a>. The article provides a step by step and easy to understand guide.
</div>
<style type="text/css">
.subtitle {
    display: block;
    font-size: 15px;
}
</style>
<p><strong>References:</strong></p>
<ol>
<li><a href="#granite-ui-checkbox">Checkbox</a></li>
<li><a href="#granite-ui-textfield">Text Field</a></li>
<li><a href="#granite-ui-textarea">Text Area</a></li>
<li><a href="#granite-ui-pathfield">Path Field</a></li>
<li><a href="#granite-ui-multifield">Multifield</a></li>
<li><a href="#granite-ui-select">Select</a></li>
<li><a href="#granite-ui-radiogroup">Radio Group</a></li>
<li><a href="#granite-ui-numberfield">Number Field</a></li>
<li><a href="#granite-ui-fileupload">File Upload</a></li>
<li><a href="#granite-ui-colorpicker">Color Picker</a></li>
<li><a href="https://sourcedcode.com/blog/aem/creating-a-basic-aem-touch-ui-dialogue" target="_blank" rel="noopener noreferrer">Creating a Basic AEM Touch UI Dialogue</a></li>
</ol>
<hr class="spacer-large"/>
<h3 id="granite-ui-checkbox">1. Checkbox <span class="subtitle">Granite UI 1.0, Touch UI XML Example:</span></h3>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">&lt;isChecked</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/checkbox&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;isChecked?&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./isChecked&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">text</span>=<span style="color: #ff0000;">&quot;isChecked flag&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">uncheckedValue</span>=<span style="color: #ff0000;">&quot;{Boolean}false&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></div></td></tr></tbody></table></div>
<p>sling:resourceType: granite/ui/components/coral/foundation/form/checkbox<br />
Documetation: <a href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/checkbox/index.html" rel="noopener nofollow noreferrer" target="_blank">https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/checkbox/index.html</a></p>
<hr class="spacer-large"/>
<h3 id="granite-ui-textfield">2. Text Field <span class="subtitle">Granite UI 1.0, Touch UI XML Example:</span></h3>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">&lt;textfield-example</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/textfield&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;textfield-example&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./example&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;{String}Default Text&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">emptyText</span>=<span style="color: #ff0000;">&quot;Show placeholder text when input field is empty.&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">disabled</span>=<span style="color: #ff0000;">&quot;{Boolean}false&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">required</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">autocomplete</span>=<span style="color: #ff0000;">&quot;off&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">autofocus</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">validation</span>=<span style="color: #ff0000;">&quot;&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">maxlength</span>=<span style="color: #ff0000;">&quot;{Long}100&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">&lt;textfield-example-brandSlogan</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/textfield&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;Brand Slogan&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">required</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./brandSlogan&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></div></td></tr></tbody></table></div>
<p>sling:resourceType: granite/ui/components/coral/foundation/form/textfield<br />
Documentation: <a href="https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/textfield/index.html" rel="noopener nofollow noreferrer" target="_blank">https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/textfield/index.html</a></p>
<h3 id="granite-ui-textarea">3. Text Area <span class="subtitle">Granite UI 1.0, Touch UI XML Example:</span></h3>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">&lt;textarea-example-description</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/textarea&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;Description&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./description&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">emptyText</span>=<span style="color: #ff0000;">&quot;A hint to the user of what can be entered in the field.&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">disabled</span>=<span style="color: #ff0000;">&quot;{Boolean}false&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">required</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">autocomplete</span>=<span style="color: #ff0000;">&quot;off&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">autofocus</span>=<span style="color: #ff0000;">&quot;{Boolean}false&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">maxlength</span>=<span style="color: #ff0000;">&quot;{Long}160&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">rows</span>=<span style="color: #ff0000;">&quot;100&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">resize</span>=<span style="color: #ff0000;">&quot;both&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></div></td></tr></tbody></table></div>
<p>sling:resourceType: granite/ui/components/coral/foundation/form/textarea<br />
Documentation: <a href="https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/textarea/index.html" rel="noopener nofollow noreferrer" target="_blank">https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/textarea/index.html</a></p>
<hr class="spacer-large"/>
<h3 id="granite-ui-pathfield">4. Path Field <span class="subtitle">Granite UI 1.0, Touch UI XML Example:</span></h3>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">&lt;pathfield-example-logoPath</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/pathfield&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;Logo Path&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./logoPath&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">required</span>=<span style="color: #ff0000;">&quot;true&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">rootPath</span>=<span style="color: #ff0000;">&quot;/content/dam&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></div></td></tr></tbody></table></div>
<p>sling:resourceType: granite/ui/components/coral/foundation/form/pathfield<br />
Documentation: <a href="https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/pathfield/index.html" rel="noopener nofollow noreferrer" target="_blank">https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/pathfield/index.html</a></p>
<hr class="spacer-large"/>
<h3 id="granite-ui-multifield">5. Multifield <span class="subtitle">Granite UI 1.0, Touch UI XML Example:</span></h3>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">// Multifield Country Eexample<br />
<span style="color: #000000; font-weight: bold;">&lt;countries</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/multifield&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">composite</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;Countries&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;field</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/container&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./countries&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;items</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;name</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/textfield&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">emptyText</span>=<span style="color: #ff0000;">&quot;Name&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./name&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;code</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/textfield&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">emptyText</span>=<span style="color: #ff0000;">&quot;Code&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./code&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/items<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<span style="color: #000000; font-weight: bold;">&lt;/countries<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<br />
// Navigation Links Example<br />
<span style="color: #000000; font-weight: bold;">&lt;navigationLinksMultifield</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/multifield&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">composite</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;Navigation Links&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;field</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/container&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./navLinks&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;items</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;linkLabel</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/textfield&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;Link Label&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./linkLabel&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">required</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;linkPath</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/pathfield&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;Link Path&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./linkPath&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">required</span>=<span style="color: #ff0000;">&quot;true&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">rootPath</span>=<span style="color: #ff0000;">&quot;/content&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;linkTarget</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/select&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;CTA Link Target&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./linkTarget&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;items</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;self</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">selected</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">text</span>=<span style="color: #ff0000;">&quot;Same Page&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;_self&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;blank</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">text</span>=<span style="color: #ff0000;">&quot;New Tab&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;_blank&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/items<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/linkTarget<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/items<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<span style="color: #000000; font-weight: bold;">&lt;/navigationLinksMultifield<span style="color: #000000; font-weight: bold;">&gt;</span></span></div></td></tr></tbody></table></div>
<p>sling:resourceType: granite/ui/components/coral/foundation/form/multifield<br />
Documentation: <a href="https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/multifield/index.html" rel="noopener nofollow noreferrer" target="_blank">https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/multifield/index.html</a></p>
<hr class="spacer-large"/>
<h3 id="granite-ui-select">6. Select <span class="subtitle">Granite UI 1.0, Touch UI XML Example:</span></h3>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">&lt;linkTarget</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/select&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;CTA Link Target&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./linkTarget&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;items</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;self</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">selected</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">text</span>=<span style="color: #ff0000;">&quot;Same Page&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;_self&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;blank</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">text</span>=<span style="color: #ff0000;">&quot;New Tab&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;_blank&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/items<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<span style="color: #000000; font-weight: bold;">&lt;/linkTarget<span style="color: #000000; font-weight: bold;">&gt;</span></span></div></td></tr></tbody></table></div>
<p>sling:resourceType: granite/ui/components/coral/foundation/form/select<br />
Documentation: <a href="https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/select/index.html" rel="noopener nofollow noreferrer" target="_blank">https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/select/index.html</a></p>
<hr class="spacer-large"/>
<h3 id="granite-ui-radiogroup">7. Radio Group <span class="subtitle">Granite UI 1.0, Touch UI XML Example:</span></h3>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">&lt;radiogroup-example-columns</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/radiogroup&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">deleteHint</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;Type&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./columns&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">vertical</span>=<span style="color: #ff0000;">&quot;{Boolean}false&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;items</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;columns1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">checked</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">text</span>=<span style="color: #ff0000;">&quot;1 Column&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;columns2</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">text</span>=<span style="color: #ff0000;">&quot;2 Columns&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;2&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;columns3</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">text</span>=<span style="color: #ff0000;">&quot;3 Columns&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;3&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/items<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<span style="color: #000000; font-weight: bold;">&lt;/radiogroup-example-columns<span style="color: #000000; font-weight: bold;">&gt;</span></span></div></td></tr></tbody></table></div>
<p>sling:resourceType: granite/ui/components/coral/foundation/form/radiogroup<br />
Documentation: <a href="https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/radiogroup/index.html" rel="noopener nofollow noreferrer" target="_blank">https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/radiogroup/index.html</a></p>
<hr class="spacer-large"/>
<h3 id="granite-ui-numberfield">8. Number Field <span class="subtitle">Granite UI 1.0, Touch UI XML Example:</span></h3>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">&lt;numberfield-example-ageRestriction</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/numberfield&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;Age Restriction&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">min</span>=<span style="color: #ff0000;">&quot;{Long}1&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">max</span>=<span style="color: #ff0000;">&quot;{Double}200&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./ageRestriction&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">disabled</span>=<span style="color: #ff0000;">&quot;{Boolean}false&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">step</span>=<span style="color: #ff0000;">&quot;1&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></div></td></tr></tbody></table></div>
<p>sling:resourceType: granite/ui/components/coral/foundation/form/numberfield<br />
Documentation: <a href="https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/numberfield/index.html" rel="noopener nofollow noreferrer" target="_blank">https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/numberfield/index.html</a></p>
<hr class="spacer-large"/>
<h3 id="granite-ui-fileupload">9. File Upload <span class="subtitle">Granite UI 1.0, Touch UI XML Example:</span></h3>
<p>Note: How to disable the file upload, browser button, granite UI component&#8217;s upload feature will be to set the allowUpload property to false, indicated in the examples below.</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">&lt;file</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;cq/gui/components/authoring/dialog/fileupload&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;cq-droptarget&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">fileNameParameter</span>=<span style="color: #ff0000;">&quot;./fileName&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">fileReferenceParameter</span>=<span style="color: #ff0000;">&quot;./fileReference&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">mimeTypes</span>=<span style="color: #ff0000;">&quot;[image/gif,image/jpeg,image/png,image/tiff,image/svg+xml]&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./file&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
// in sightly <span style="color: #000000; font-weight: bold;">&lt;img</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;${properties.fileReference}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
<br />
<br />
<span style="color: #000000; font-weight: bold;">&lt;fileupload-example-file</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;cq/gui/components/authoring/dialog/fileupload&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">autoStart</span>=<span style="color: #ff0000;">&quot;{Boolean}false&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;cq-droptarget&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;Image asset&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">fileNameParameter</span>=<span style="color: #ff0000;">&quot;./fileName&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">fileReferenceParameter</span>=<span style="color: #ff0000;">&quot;./fileReference&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">mimeTypes</span>=<span style="color: #ff0000;">&quot;[image/gif,image/jpeg,image/png,image/tiff,image/svg+xml]&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">multiple</span>=<span style="color: #ff0000;">&quot;{Boolean}false&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./file&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;Upload Image Asset&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">uploadUrl</span>=<span style="color: #ff0000;">&quot;${suffix.path}&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">useHTML5</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
// in sightly <span style="color: #000000; font-weight: bold;">&lt;img</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;${properties.fileReference}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
<br />
// disable allow upload<br />
<span style="color: #000000; font-weight: bold;">&lt;fileupload-example-downloadAsset</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;cq/gui/components/authoring/dialog/fileupload&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">allowUpload</span>=<span style="color: #ff0000;">&quot;{Boolean}false&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">autoStart</span>=<span style="color: #ff0000;">&quot;{Boolean}false&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;cq-droptarget&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;Download Asset&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">fileNameParameter</span>=<span style="color: #ff0000;">&quot;./fileName&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">fileReferenceParameter</span>=<span style="color: #ff0000;">&quot;./fileReference&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">mimeTypes</span>=<span style="color: #ff0000;">&quot;[image/*,video/*,audio/*,.pdf,.doc,.zip,.txt]&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">multiple</span>=<span style="color: #ff0000;">&quot;{Boolean}false&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./downloadAsset&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;Upload Asset&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">uploadUrl</span>=<span style="color: #ff0000;">&quot;${suffix.path}&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">useHTML5</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
// in sightly <span style="color: #000000; font-weight: bold;">&lt;img</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;${properties.fileReference}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></div></td></tr></tbody></table></div>
<p>sling:resourceType: cq/gui/components/authoring/dialog/fileupload<br />
Documentation: <a href="https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/fileupload/index.html" rel="noopener nofollow noreferrer" target="_blank">https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/fileupload/index.html</a></p>
<hr class="spacer-large"/>
<h3 id="granite-ui-colorpicker">10. Color Picker <span class="subtitle">Granite UI 1.0, Touch UI XML Example:</span></h3>
<p>Note: the variant properties can be set for two different outcomes; &#8220;default&#8221; allows the authors to insert custom hex values, while the set value of &#8220;swatch&#8221; does not allow custom hex selection.</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">//swatch example<br />
<span style="color: #000000; font-weight: bold;">&lt;colorfield-swatch-example-brandColor</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/colorfield&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;Brand Color&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./brandColor&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">emptyText</span>=<span style="color: #ff0000;">&quot;Please choose a color&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">disabled</span>=<span style="color: #ff0000;">&quot;{Boolean}false&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">required</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">variant</span>=<span style="color: #ff0000;">&quot;swatch&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">autogenerateColors</span>=<span style="color: #ff0000;">&quot;off&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">showDefaultColors</span>=<span style="color: #ff0000;">&quot;{Boolean}false&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">showProperties</span>=<span style="color: #ff0000;">&quot;{Boolean}false&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">showSwatches</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;items</span> <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;color1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;#FF4136&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;color2</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;#0077D9&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/items<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<span style="color: #000000; font-weight: bold;">&lt;/colorfield-swatch-example-brandColor<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<br />
//properties example <span style="color: #66cc66;">&#40;</span>choosing colors from a color wheel<br />
<span style="color: #000000; font-weight: bold;">&lt;colorfield-properties-example-brandColor</span><br />
&nbsp; &nbsp; <span style="color: #000066;">jcr:primaryType</span>=<span style="color: #ff0000;">&quot;nt:unstructured&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">sling:resourceType</span>=<span style="color: #ff0000;">&quot;granite/ui/components/coral/foundation/form/colorfield&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">fieldLabel</span>=<span style="color: #ff0000;">&quot;Brand Color&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;./brandColor&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">emptyText</span>=<span style="color: #ff0000;">&quot;Please choose a color&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">disabled</span>=<span style="color: #ff0000;">&quot;{Boolean}false&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">required</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">variant</span>=<span style="color: #ff0000;">&quot;default&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">autogenerateColors</span>=<span style="color: #ff0000;">&quot;off&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">showDefaultColors</span>=<span style="color: #ff0000;">&quot;{Boolean}false&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">showProperties</span>=<span style="color: #ff0000;">&quot;{Boolean}true&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">showSwatches</span>=<span style="color: #ff0000;">&quot;{Boolean}false&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></div></td></tr></tbody></table></div>
<p>sling:resourceType: granite/ui/components/coral/foundation/form/colorfield<br />
Documentation: <a href="https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/colorfield/index.html" rel="noopener nofollow noreferrer" target="_blank">https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/colorfield/index.html</a></p>
<div class="mention-block">
<strong>Recommended Note:</strong><br />
If you want to understand how to convert Granite UI 1.0 Form Components from Adobe&#8217;s documentation to XML format, have a look at <a href="https://sourcedcode.com/blog/aem/how-to-convert-adobes-granite-ui-1-0-documentation-to-xml" title="How to convert Adobe’s Granite UI 1.0 Documentation to XML" rel="noopener noreferrer" target="_blank">article</a>. The article provides a step by step and easy to understand guide.
</div>
<p>The post <a rel="nofollow" href="https://sourcedcode.com/blog/aem/aem-granite-ui-1-0-form-components-xml-cheat-sheet-reference-guide">AEM Granite UI 1.0 Form Component&#8217;s XML Cheat Sheet Reference Guide</a> appeared first on <a rel="nofollow" href="https://sourcedcode.com">Sourced Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sourcedcode.com/blog/aem/aem-granite-ui-1-0-form-components-xml-cheat-sheet-reference-guide/feed</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
