How to break in a <ui:repeat>
Is there any easy way I can break in a ui:repeat loop ?
I'm trying to do it the following way, but it does not work. The idea is to print th开发者_开发技巧e image when, requestScope.counter == 1.
<c:set target="#{requestScope}" property="counter" value="0" />
<ui:repeat var="mediaVar" value="#{brandsVar.brandBrandMedia}" >
<ui:fragment rendered="#{mediaVar.bmType eq 'image'}">
<ui:param name="#{requestScope.counter}" value="#{requestScope.counter + 1}" />
</ui:fragment>
<h:graphicImage rendered="#{mediaVar.bmType eq 'image' && requestScope.counter == 1}"
height="100" width="100"
value="location of image" />
</ui:repeat>
You can't break in an ui:repeat
. As to your concrete problem, use and
instead of &&
.
精彩评论