multiple if tags are not working for next iteration
JETT - Java Excel Template Translator
Status: Beta
Brought to you by:
rgettman
I have just created two if statement tags within a foreach tag. For the first iteration everything goes fine but for the next iteration second if statement doesnt get executed. When i debug the code i can see that second if condition is process for the expression evaluation.
<jt:forEach items="${values}" var="value" indexVar="index"> <jt:if test="${index==0}"> <jt:style style="bottom-border-color:${color}"/> </jt:if> <jt:if test="${index>0}"> <jt:style style="bottom-border-color:${color2}"> </jt:if>
</jt:forEach>
Diff:
I have edited your post to format your JETT code so that it shows up and isn't interpreted as HTML.
However, it's unclear in which cells each tag is located. Please post an example template spreadsheet that demonstrates the problem.
You may also place the condition inside the JEXL expression itself, and avoid a
<jt:if>
tag, something like this:Won't fix; not enough information to determine the problem.
<jt:foreach var="csItem" items="${csList.subData}" copyright="true">
<jt:if test="${csItem.data02 == 'IMAGE'}">
<jt:image rows="1" pathname="${csItem.data01}" cols="1">
</jt:image></jt:if>
<jt:if test="${csItem.data02 != 'IMAGE'}">
${csItem.data01}
</jt:if>
</jt:foreach>
It is not work.!