Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

[AEM Gems Webinar] Accelerating Experience Manager as a Cloud Service development with Rapid Development Environments
SOLVED

granite cq-msm-lockable autocomplete

Avatar

Level 2

<pagecategory
cq:showOnCreate="{Boolean}true"
granite:class="page-tagging-inheritance"
jcr:primaryType="nt:unstructured"
fieldLabel="page.pagecategory.label"
fieldDescription="page.pagecategory.label.desc"
sling:resourceType="granite/ui/components/coral/foundation/form/autocomplete"
autocreateTag="{Boolean}false"
emptyText="page.tag.singleSelect.emptyText"
name="./pagetagging/pageCategory"
required="{Boolean}true"
mode="contains">
<granite:data
jcr:primaryType="nt:unstructured"
cq-msm-lockable="pagetagging/pagecategory"
pagecategory-field=""/>
<datasource
jcr:primaryType="nt:unstructured"
sling:resourceType="cio-sites/components/page/dialog-sections/pagetagging/items/column/items/pagecategory"/>
<values
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/autocomplete/tags"/>
<options
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/autocomplete/list"/>
</pagecategory>

 

 

gdguradio_0-1653640291347.pnggdguradio_1-1653640309411.png

I have the above field converted from tagfield into an autocomplete field . When I roll out page(using the tagfield resource type) the field is working as expected. When I change the resource type to auto complete and roll out page the field loses its value. When I tried to remove the property " cq-msm-lockable="pagetagging/pagecategory" " the field didnt lose its value but didnt get the disabled and the chain icon. 

My question is how can I use an autocomplete resourcetype together with the property " cq-msm-lockable="pagetagging/pagecategory" " and not lose the value of the field when I roll out the page

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Understood. I have tested granite/ui/components/coral/foundation/form/autocomplete with granite cq-msm-lockable on AEM6.5.9 and it's working.

DEBAL_DAS_0-1653723764466.pngDEBAL_DAS_1-1653723805525.png

 

DEBAL_DAS_2-1653723901570.png

At us-en level :

DEBAL_DAS_3-1653723970125.png

at ca-en level :

DEBAL_DAS_4-1653723996983.png

 

Please note that: /libs/granite/ui/components/coral/foundation/form/autocomplete is deprecated

https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/...

 

View solution in original post

0 Replies

Avatar

Level 2

Turns out that I made a typo error cq-msm-lockable="pagetagging/pagecategory" to cq-msm-lockable="pagetagging/pageCategory"

Avatar

Correct answer by
Community Advisor

Understood. I have tested granite/ui/components/coral/foundation/form/autocomplete with granite cq-msm-lockable on AEM6.5.9 and it's working.

DEBAL_DAS_0-1653723764466.pngDEBAL_DAS_1-1653723805525.png

 

DEBAL_DAS_2-1653723901570.png

At us-en level :

DEBAL_DAS_3-1653723970125.png

at ca-en level :

DEBAL_DAS_4-1653723996983.png

 

Please note that: /libs/granite/ui/components/coral/foundation/form/autocomplete is deprecated

https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/...

 

Avatar

Level 1

Could you please provide me the XML and the possible HTML or js or other files if there are involved on how to create the autocomplete, I am a very beginner in AEM and very confused about this field

Avatar

Community Advisor

<category
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/autocomplete"
emptyText="Client library category"
fieldLabel="Category"
mode="contains"
multiple="{Boolean}false"
name="./clientlibsJsHead"
required="{Boolean}false">
<datasource
jcr:primaryType="nt:unstructured"
sling:resourceType="core/wcm/components/commons/datasources/clientlibrarycategories/v1"
type="js"/>
<options
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/autocomplete/list"/>
<granite:data
jcr:primaryType="nt:unstructured"
cq-msm-lockable="clientlibsJsHead"/>
</category>