Issue in including the component | Community
Skip to main content
girishk14
Level 2
June 6, 2018
Solved

Issue in including the component

  • June 6, 2018
  • 10 replies
  • 3865 views

Hi All,

I am trying to include the componentB into componentA using the data-sly-resource with below syntax in the parent component (Component A)

<div data-sly-resource="${ 'title' @ resourceType='myproject/component/content/title '}"></div>

When I drag the component A, I am able to open the dialog box of component B and it throws an below error only for the first time when we try to  open the dialog.

Error during include of component '/apps/myproject/components/content/componentB'

Error Message:

org.apache.sling.api.scripting.ScriptEvaluationException:

Processing Info:

I suspect because the node for componentB has not created under jcr:content of page path ,It is created once we open the dialog and add some configuration, Is there any way I can create the node manually for the component B when the parent component A is dragged on the page.

Thanks in advance,

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by girishk14

Hi All,

Thanks for the response,

The issue is with the child component and able to sort it by modify sightly call in child component

10 replies

arunpatidar
Community Advisor
Community Advisor
June 6, 2018

Hi,

Which version are you using?

I tried in 6.3 I am not getting any error and node is getting created for componentB.

below is my code.

Thanks

Arun

Arun Patidar
girishk14
girishk14Author
Level 2
June 6, 2018

Hi Arun,

I am using the Aem 6.3 with SP2

Is the cmp node is created as soon as I drag the parent component , without opening the dialog of div-check component ??

smacdonald2008
Level 10
June 6, 2018

Is your Component A a container component like a Responsive Layout container?

arunpatidar
Community Advisor
Community Advisor
June 6, 2018

Hi Girish,

No, cmp node is getting created after opening dialog but I am not getting any error which you've mentioned.

Arun Patidar
girishk14
girishk14Author
Level 2
June 6, 2018

Hi scott,

It's not a container component.

girishk14
girishk14Author
Level 2
June 6, 2018

Hi Arun,

Is there any way to create the node dynamically when the parent component is dragged.

Ratna_Kumar
Level 10
June 6, 2018

Hi,

I am not seeing any error. See the screenshot show.

Thanks,

Ratna Kumar.

Ratna_Kumar
Level 10
June 6, 2018

Hi,

Title node is getting created after when you edit the dialog of the included component. See the image below.

Thanks,

Ratna Kumar.

smacdonald2008
Level 10
June 6, 2018

I am not a big fan of nesting components - unless the parent is a container - like a Grid layout and the child is a component that is suppose to go within the grid - like a card compoennt. For example - the Grid Parent component:

The child card components:

This shows a better practice of parent/child AEM components.

girishk14
girishk14AuthorAccepted solution
Level 2
June 6, 2018

Hi All,

Thanks for the response,

The issue is with the child component and able to sort it by modify sightly call in child component