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

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

Avatar

Level 5

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

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