Expand my Community achievements bar.

data-sly-repeat define max item via cq dialog

Avatar

Level 2

I am trying to use data-sly-repeat and need to define the max item to repeat. I though I could use the following HTL but if i replace the number with properties from the dialog (maxItems - sling:resourceType="granite/ui/components/coral/foundation/form/numberfield"), the component breaks with error Cannot get DefaultSlingScript: Operands are not of the same type: comparison is supported for Number types only.

<sly data-sly-repeat="${reference.items @ begin = 0, end = properties.maxItems}">

Is there a simple way of using only HTL to achieve this? I also tried ${properties.maxItems @ context='number'} but no luck

Thanks in advance.

13 Replies