开发者

How to break in a <ui:repeat>

开发者 https://www.devze.com 2023-02-18 17:58 出处:网络
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.

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' &amp;&amp;  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 &amp;&amp;.

0

精彩评论

暂无评论...
验证码 换一张
取 消