Sling Model Multivalue Page level property reading

khamat_bn

08-06-2020

Hello Guys,

I want to read the property of page level cq:tags which will be multivalue. If I trying to read the property by 

pageNodes.getProperty("cq:tags").getValue().toString()

its saying cq:tags is multivalue. can anyone tell me how i can read this property.

 

Regards,

~BK

 

AEM Sling Model
View Entire Topic

khamat_bn

09-06-2020

Hello @a74048191r ,

Thanks for the response, I tried the lines that u posted. Unfortunately, it didn't work for me.

But I ended up with the solution that works for me. Posting Here so others can also use it if required.

private Value[] tagsFromPage;

for
(Value eachTag : tagsFromPage) {
log.info("tagsFromPage value: {}", eachTag.toString());
}