Hi All, <#if check.apply?has_content &&...
# advancedpdf
g
Hi All, <#if check.apply?has_content && check.apply?length lte 15>
y
You can check using condition under loop and break the loop once touch 15
<#list 1..100 as count> ${count} <#if count == 15> #break </#if> </#list>
y
you can use apply_index. once you define apply (<list check.apply as apply> you can add <#if apply_index lt 15>
d
Would encourage bookmarking the FreeMarker Manual One tidy way of doing this would be:
Copy code
<#list check.apply[0..*15] as apply>

</#list>
which is an example of Sequence slicing t(
NOTE, the
0..*15
means from 0th element with length of 15, and won't throw an error if there are less than 15 elements. As opposed to
0..14
which slices from 0th to 14th element and would error if <15 elements
g
But if more than 15 lines..I need to show some message
How to include this condition as well
I want to check if more than 15 lines I need to show message then if less than or equals to 15 then need to show the line items in advanced pdf
Any body have any idea on this??
d
Sorry, misunderstood. In that case you want to use ?size (starts at zero)
<#if check.apply?has_content && check.apply?size lte 14>
(size of 14 == 15 elements)