how can we put two custom component on same page in AEM as a cloud service? | Community
Skip to main content
Level 4
September 22, 2022
Solved

how can we put two custom component on same page in AEM as a cloud service?

  • September 22, 2022
  • 1 reply
  • 919 views

I have a custom component say "componentA"

->I am writing my business logic in my sling model of the component and using the fields via annotation @ValueMapValue 

->and using the properties in HTL via e.g : ${model.propertyOne}

-> But when I put two component on the same page , my HTL behaves very differently , only the latest added changes are reflecting on both my HTL and on website

-> My guess is it's happening because the model file is same and it's only picking the latest changes and passing it to the HTML 

-> How can I prevent this behavior and what steps should be taken care to use two components on the same page

 

Thank you

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 arunpatidar

Hi,

The component will be behaving same because of same htl, model etc and this is normal.

 

The Authored/values must be different in order to get different results.

 

Please check and make sure you don't have any static field which you return in the component output. 

1 reply

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
September 22, 2022

Hi,

The component will be behaving same because of same htl, model etc and this is normal.

 

The Authored/values must be different in order to get different results.

 

Please check and make sure you don't have any static field which you return in the component output. 

Arun Patidar