Hi All,
Since TagPicker is deprecated from AEM 6.3. I want to migrate to TagField touch ui. rootpath property is a string so can give one specific namespace path (eg:/content/cq:tags/forum). I have a requirement to list multiple namespaces(rootpath) in tagfield touch ui dialog.
rootpath = "/content/cq:tags" - list all namespaces in cq:tags folder
rootpath = "/content/cq:tags/forum" - (single namespaces) list the children of forum namespace
Requirement: Tagfield dailog columnview should populate the tags from "/content/cq:tags/forum", "/content/cq:tags/namespace1", "/content/cq:tags/namespace2", "/content/cq:tags/namespace3"
Need to list more than one namespaces and list set of namespaces in each tagfield dialog. How to achieve this?
Solved! Go to Solution.
Views
Replies
Total Likes
@Jerald_Rolance : As it has been highlighted, rootPath allows a string value, meaning you can specify one value.
I think that leaves you with no option but to think of alternatives. What I can think of are:
You can decide which approach suits more to your requirements.
Hope this helps.
thanks.
Hi @Jerald_Rolance
I did not understand you question properly. If you have issue related to selection of multiple tags fields please check below for the reference and it is working.
You need to set a Boolean property multiple as true.
Field view in Dialog
Thank You.
I want to have multiple rootpath.
Tagfield dailog columnview should populate the tags from
["/content/cq:tags/forum", "/content/cq:tags/namespace1", "/content/cq:tags/namespace2", "/content/cq:tags/namespace3"]
I'm not able to achieve this because rootpath is a String, couldn't provide multiple values.
Yes you can use root path for Tag picker field. Please refer below URL:
Thanks.
Hi @Raja_Reddy
I want to have multiple rootpath.
Tagfield dailog columnview should populate the tags from
["/content/cq:tags/forum", "/content/cq:tags/namespace1", "/content/cq:tags/namespace2", "/content/cq:tags/namespace3"]
I'm not able to achieve this because rootpath is a String, couldn't provide multiple values.
Hi Jerald,
In the tag field you can select multiple tags by adding a property multiple="{Boolean}true" or can define the root path like below.
<tags
jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/coral/common/form/tagfield"
fieldLabel="Select Tags"
multiple="{Boolean}true"
rootPath="/content/cq:tags/geography"
name="./tag"/>
If you want to have multiple root path options apart from the default one then you can add a dropdown field in the dialog with the root paths as options and use javascript to use that dropdown field value as the root path value in the tag field.
Hope its clear.
Thanks,
Sweta
Hi @SwetaB
Yes, I want to have multiple rootpath.
Example:
["/content/cq:tags/forum", "/content/cq:tags/namespace1", "/content/cq:tags/namespace2", "/content/cq:tags/namespace3"]
Need to list more than one namespaces and list set of namespaces in each tagfield dialog.
I'm not able to achieve this because rootpath accpets one String value.
Hi @Jerald_Rolance
I think if it is not possible to have more than one namespace then you have to use /content/cq:tags as root, which will cover all the root and upon submit or selection, you may need to write a custom validation check for those 2 namespaces.
Here is the example
@Jerald_Rolance You can't store multiple values in root path see below error
You can add validation on rootpath selection let me know if it helps
Yes, need to write custom validation from rootpath. Will work on the custom validation.
Option1 - you can use extraclientlibs category dam.gui.coral.metadataeditor when ever you open metadata property JS will be trigger, on that JS you can add logic to check paths as per your need or not or you can give an error on metadata page
@Jerald_Rolance 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.
Views
Replies
Total Likes
@kautuk_sahni Still didn't get expected information from suggestions. Need more suggestion from community.
@Jerald_Rolance : As it has been highlighted, rootPath allows a string value, meaning you can specify one value.
I think that leaves you with no option but to think of alternatives. What I can think of are:
You can decide which approach suits more to your requirements.
Hope this helps.
thanks.
Thanks @Kamal_Kishor