Cette conversation a été verrouillée en raison de son inactivité. Veuillez créer une nouvelle publication.
Niveau 1
Niveau 2
Se connecter à la communauté
Connectez-vous pour voir tous les badges
Cette conversation a été verrouillée en raison de son inactivité. Veuillez créer une nouvelle publication.
Is there a way to test if listChildren will return anything? Something along the line of: <sly data-sly-test=${item.listChildren.size > 0} />
Good question - here is more explanation on test -- htl-spec/SPECIFICATION.md at master · adobe/htl-spec · GitHub
See Section -- 2.2.5. Test
Vues
Réponses
Nombre de J’aime
You can call any method that has no arguments in data-sly-test.
In your case check if your item has these methods.
Thank you all! Your answers pointed me to a solution. I was able to test whether or not the item had children this way:
<sly data-sly-test=${item.listChildren.hasNext} />
This one did not work for me though the original check for item.children.size == 0 worked well
Vues
Réponses
Nombre de J’aime
Just an update the data-sly-test="${item.children.size == 0} and data-sly-test="${item.children.size > 0} worked for me as intended.
Vues
Likes
Réponses