Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Error in creating a custom widget in dialog ??

Avatar

Former Community Member

Hi ,

Today I follow this document "http://helpx.adobe.com/experience-manager/using/creating-aem-multifield-components.html" and created once custom component with custom widget.

 

I have few doubts in this doc .

1.What is the purpose of using rtePlugin node ?

2.Edit behavior is necessary for dropping the image from content finder to web page or dialog,without this editorial behavior  dropping is working fine .

3.When using the custom created xtype with fieldConfig node in dialog am getting this exception

"uncaught exception: cannot create Component: xtype 'mytextbutton' not found and no default supplied "? (ClientLib folder is configured)

Please suggest me a solutions.

Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Level 10

The rtePlugin lets you define styles and behaviour for the Rich Text Editor (RTE). For example - as discussed in the doc - you can define a strike through behaviour that appears in the RTE:

[img]StrikeThrough.png[/img]

For more information about RTEPlugins -- see: http://dev.day.com/docs/en/cq/current/administering/configuring_rich_text_editor.html

You are getting this exception because CQ cannot find your custom xtype that you are using in the component.

In this article - the custom xtype is defined and registered in the CustomWidget.js file:

// register xtype
CQ.Ext.reg("ejstcustom", Ejst.CustomWidget);

Now for this to work -- you have to setup a CQ:ClientLibraryFolder node (as shown in the doc). Make sure that the JS scripts that define the custom xtype are included in this node. Next make sure that you reference the CQ:ClientLibraryFolder node in your component's JSP (for example Hero.jsp). For example - in the article - the categories property value of the CQ:ClientLibraryFolder node is hook.components

In Hero.js (the component main JSP) - we reference hook.components like this:

<cq:includeClientLib categories="hook.components" />

If you do not include the cq:includeCleintLib and reference the ClientLib node properly in your component JSP -- CQ will not find your custom xtype and this error occurs. 

The article was tested and works in CQ 5.5 and 5.6. 

Hope this helps. 

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

The rtePlugin lets you define styles and behaviour for the Rich Text Editor (RTE). For example - as discussed in the doc - you can define a strike through behaviour that appears in the RTE:

[img]StrikeThrough.png[/img]

For more information about RTEPlugins -- see: http://dev.day.com/docs/en/cq/current/administering/configuring_rich_text_editor.html

You are getting this exception because CQ cannot find your custom xtype that you are using in the component.

In this article - the custom xtype is defined and registered in the CustomWidget.js file:

// register xtype
CQ.Ext.reg("ejstcustom", Ejst.CustomWidget);

Now for this to work -- you have to setup a CQ:ClientLibraryFolder node (as shown in the doc). Make sure that the JS scripts that define the custom xtype are included in this node. Next make sure that you reference the CQ:ClientLibraryFolder node in your component's JSP (for example Hero.jsp). For example - in the article - the categories property value of the CQ:ClientLibraryFolder node is hook.components

In Hero.js (the component main JSP) - we reference hook.components like this:

<cq:includeClientLib categories="hook.components" />

If you do not include the cq:includeCleintLib and reference the ClientLib node properly in your component JSP -- CQ will not find your custom xtype and this error occurs. 

The article was tested and works in CQ 5.5 and 5.6. 

Hope this helps. 

Avatar

Former Community Member

Thanks man.

We found the problem and now its working.

You didn't say anything about my edit behavior point which i asked in my previous post. Please have look at my previous post as well as this link i mentioned below

http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...