Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

cq:actionConfigs in Touch UI vs Classic UI - Some code could not be run

Avatar

Level 3

I have a component that has sub-components that the author can add as needed.  To do this in classic UI we setup following in the authorclientlib:

CompanyName.Components.Parent = function (jQuery) { 'use strict'; return { addChild: function(component) { jQuery.post(); } }; }(jQuery);

and in the cq:editConfig:cq:actionConfigs:

handler=function(){CompanyName.Components.Parent.addChild(this)}

This works great for classic UI, but every time I click on the add button in Touch UI I receive a message saying: "Some code could not be run".  I assume that I need to add the CompanyName.Components.Parent.addChild to the edit layer, but from the references I am finding I am not very sure how to do this.  Would someone be able to help (if it matters we are on 6.0, SP1)?

Thanks in advance!

3 Replies

Avatar

Employee Advisor

Have you set a property "categories" of String type to "cq.authoring.dialog" on client library node (cq:ClientLibraryFolder) ? 

Avatar

Level 3

I had not, but I have added it now (see attachment).  It has not helped.  Do I need to add a separate clientlib that roles up the cq.authoring.dialog or should it do it automatically?  Thanks.

Avatar

Employee Advisor

Also, add dependencies property to the clientlib node and set it's value to - "granite.jquery". And change your code to use jQuery from Granite as below-

 

         (function (document, $) {

  1. 'use strict';
  2.  
  3. return {
  4. addChild: function(component) {
  5. $.post();
  6. }
  7. };
  8. })(document,Granite.$);