I want to set a default value for my cq:tag which is using a tagpicker (cq/gui/components/common/tagspicker). Is there anyone know how to configure it? I am using AEM 6.3 touch UI.
Solved! Go to Solution.
I made it by adding listeners.js in clientlins folder to the component. The following is example:
$document.on("dialog-ready", function() {
// add logic here
});
I am not aware of how to set a default - when you click on this field - it opens the JCR dialog where an author selects tags,
A community article that uses tag picker -- Adobe Experience Manager Help | Developing HTML Template Language Components that search for Adobe E...
Views
Replies
Total Likes
I would recommend you to have a look at this documentation: Overview of the Tagging API
The implementation of the tagging framework in AEM allows management of tags and tag content using the JCR API . The TagManager ensures that tags entered as values on the cq:tags string array property are not duplicated, it removes TagIDs pointing to non-existing tags and updates TagIDs for moved or merged tags. TagManager uses a JCR observation listener that reverts any incorrect changes. The main classes are in the com.day.cq.tagging package:
Views
Replies
Total Likes
Thanks for your response. I want to set a default value on my "cq:tags" field of my component via dialog configurations. Is it possible? I am trying to set a "value" or "defaultValue". Unfortunately, both of them don't work.
Thanks for your response and sharing. Really appreciate!!
Views
Replies
Total Likes
Set the default value and
Add a listeners node to your xtype tags and add the loadcontent function to your listener
Working example : function(field){var x=[field.defaultValue];field.setValue(x);}
Further u can tweak the loadcontent function to retrieve the new selected values
Keep in mind xtype is for Classic UI.
Views
Replies
Total Likes
A small tweak to the Listener, just to avoid showing the defaultValue even after modifying the Tag Field values.
'tagname' is name of the tag.
function(field, record)
{
if(record.get('tagname') == undefined)
{
var x=[field.defaultValue];
field.setValue(x);
}
}
I made it by adding listeners.js in clientlins folder to the component. The following is example:
$document.on("dialog-ready", function() {
// add logic here
});
Views
Likes
Replies