Skip to main content
Dec 13, 2018 11:46 AM UTC
Solved

How to disable autocomplete in AEM pathfield

I would like to disable "autocomplete" feature in AEM pathfield. Anyone knows how to do that, Thanks

https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/pathfield/index.html

<link
  jcr:primaryType="nt:unstructured"
  sling:resourceType="granite/ui/components/coral/foundation/form/pathfield"
  fieldLabel="Link"
  fieldDescription="Please add a link"
  rootPath="/content/"
  name="./link"
  validation="data-valid-internal-external"
  autocomplete="false"
  required="{Boolean}true"/>

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Ravi_Pampana
Ravi_PampanaAccepted solution
Community Advisor
Dec 14, 2018 5:38 PM UTC

Check below file which has the code for auto suggestion and see how can you overwrite it to achieve your requirement

/libs/granite/ui/components/coral/foundation/form/pathfield/render.jsp

Ravi Pampana

5 replies

arunpatidar
Community Advisor
Community Advisor
Dec 13, 2018 12:51 PM UTC

Hi,

If you don't want to use autocompleted you can use textfield instead of path field.

Pathfield internally uses autocompleted to create list if you want to make changes in OOTB functionality, overlay is the solution.

There is no property called autocomplete="false".

PathField — Granite UI 1.0 documentation

Translate
Arun Patidar
Dec 14, 2018 11:03 AM UTC

Hi Arun Patidar,

I know. But based on the requirement, that field's using to put an internal or an external link. So, cannot change to textfield.

Can you give me more detail (the syntax function) on the overlay solution?  it's rendering by coralui3 js. Thanks

Translate
arunpatidar
Community Advisor
Community Advisor
Dec 14, 2018 11:29 AM UTC

Yes, you can put internal/external links in text field also if you don't want selection and autocompleted list.

Translate
Arun Patidar
smacdonald2008
Level 10
Dec 14, 2018 1:15 PM UTC

Agree with Arun - In that reference doc - i am not seeing an auto complete field. Therefore - looks like there is no way using props in the dialog that you can turn this off.

You cannot use props on granite types that do not exist.

Translate
Ravi_Pampana
Community Advisor
Ravi_PampanaCommunity AdvisorAccepted solution
Community Advisor
Dec 14, 2018 5:38 PM UTC

Check below file which has the code for auto suggestion and see how can you overwrite it to achieve your requirement

/libs/granite/ui/components/coral/foundation/form/pathfield/render.jsp

Translate
Ravi Pampana