Expandir la barra de logros de la comunidad.

RESUELTAS

AEM 6 | How to access java.util.Map object in Sightly

Avatar

Level 4

If I am setting a map variable in the activate method of the component, then how to access that in sightly?

1 solución aceptada

Avatar

Respuesta correcta de
Level 10
3 Respuestas

Avatar

Employee

can you share your code of the Use-class?

Avatar

Respuesta correcta de
Level 10

Avatar

Level 4

Thanks MacDonald, It Worked.

 

I also tried with a map having custom value object as value. below is the example.

public class customVO{

    private String customVOAttr;

}

public class customPage extends WCMUse{

        private Map<String,customVO> customVOMap;

        public Map<String, customVO> getCustomVOMap() {

                return customVOMap;
        }

}

<div data-sly-list="${customPage.customVOMap.entrySet}">
        ${item.key} - ${item.value.customVOAttr} 
</div>