Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

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

Avatar

Level 4

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. 

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.