Expand my Community achievements bar.

SOLVED

xtype tags not working inside multifield

Avatar

Level 4
<tagfield jcr:primaryType="cq:WidgetfieldLabel="Select Tags" name="./subcat" xtype="multifield">
<fieldConfig jcr:primaryType="cq:Widget" xtype="tags" />
</tagfield>

I have xtype tags inside multifield. I can see data stored in JCR properly but while opening up the dialog again, it doesn't show up. In browser console, I can see below errors.

Let's say my tag is: ab:xyz

http://localhost:4502/etc/tags/default/a.tag.json - 404

http://localhost:4502/etc/tags/default/b.tag.json - 404

http://localhost:4502/etc/tags/default/:.tag.json - 404

http://localhost:4502/etc/tags/default/x.tag.json - 404

http://localhost:4502/etc/tags/default/y.tag.json - 404

http://localhost:4502/etc/tags/default/z.tag.json - 404

1 Accepted Solution

Avatar

Correct answer by
Level 10

So your use case here is to be able to perform CRUD (create, replace, update, and delete) operations on tags from a multifield control. 

There is no xtype related to tags.  See the AEM widget docs:

https://docs.adobe.com/docs/en/cq/5-6/widgets-api/index.html

To get this to work - you can write an AEM  servlet that uses AEM Java API Tagmanager. 

https://docs.adobe.com/docs/en/cq/5-6-1/javadoc/com/day/cq/tagging/TagManager.html

Then you can invoke the servlet from a custom xtype - which is just JS script. Then you can perform CRUD operations on tags from a multifield. Also - see this AEM community article to see how to invoke a Servlet from an xtype: 

Invoking Sling Servlets from AEM xtype widgets

View solution in original post

5 Replies

Avatar

Level 10

Havent tried personally, but it looks like not support OOB. refer [1] and see if it gives a clue for you to get a workaround

[1] http://stackoverflow.com/questions/30972256/aem-xtype-tags-within-multifield

Avatar

Correct answer by
Level 10

So your use case here is to be able to perform CRUD (create, replace, update, and delete) operations on tags from a multifield control. 

There is no xtype related to tags.  See the AEM widget docs:

https://docs.adobe.com/docs/en/cq/5-6/widgets-api/index.html

To get this to work - you can write an AEM  servlet that uses AEM Java API Tagmanager. 

https://docs.adobe.com/docs/en/cq/5-6-1/javadoc/com/day/cq/tagging/TagManager.html

Then you can invoke the servlet from a custom xtype - which is just JS script. Then you can perform CRUD operations on tags from a multifield. Also - see this AEM community article to see how to invoke a Servlet from an xtype: 

Invoking Sling Servlets from AEM xtype widgets

Avatar

Level 4

Above URL is just a question. There is no answer posted.

Avatar

Level 4

I already tried creating a custom multifield xtype. It works with other xtypes but not with tags.