How to disable the manual entry of the tags in tagfield | Community
Skip to main content
Nandheswara
Level 4
March 20, 2024
Solved

How to disable the manual entry of the tags in tagfield

  • March 20, 2024
  • 3 replies
  • 919 views

Hi all,

 

I need to disable the manual entry of the tags in tagfield in assert property, for example when typing the tag name in the tag field it should populate the suggested tags in the dropdown list so either i need to select from the list or else i need to select the tags using the browse icon in the tagfield, when typing the tag name in the tag field and clicking enter it should not add the tag in the field, so how can we prevent this functionality any one can give some suggestion on this please.

 

Thanks

Nandheswara

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

Hi @nandheswara 

You may need to create a custom metadata schema to add following property to tag field

 

/** * Indicates if the user must only select from the list of given options. * If it is not forced, the user can enter arbitrary value. */ - forceSelection (Boolean) /** * When ``forceSelection = false``, ``true`` to create the user defined tag during form submission; ``false`` otherwise. */ - autocreateTag (Boolean)

 

/libs/cq/gui/components/coral/common/form/tagfield/render.jsp

3 replies

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
March 20, 2024

Hi @nandheswara 

You may need to create a custom metadata schema to add following property to tag field

 

/** * Indicates if the user must only select from the list of given options. * If it is not forced, the user can enter arbitrary value. */ - forceSelection (Boolean) /** * When ``forceSelection = false``, ``true`` to create the user defined tag during form submission; ``false`` otherwise. */ - autocreateTag (Boolean)

 

/libs/cq/gui/components/coral/common/form/tagfield/render.jsp

Arun Patidar
anupampat
Community Advisor
Community Advisor
March 20, 2024

Hi @nandheswara ,

 

Just wondering why are you trying to prevent the enter key on a tagfield? When you try to add a bad value which is not resolved as tag, you should not be able to save the dialog. I tried on a Page Property and get the error while saving it-

 

 

MayurSatav
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
March 21, 2024

@nandheswara , Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.