handling orphaned columns in a dynamic check boxes tile:

<td
               <%-- to handle orphaned columns:
                   if last in collection, find how many short of full row.
               --%>
               <c:set var="scope">
                   <tiles:getAsString name="collection_scope" />
               </c:set>

<c:choose>
<c:when test="${scope == 'page'}">
<c:set var="ck_options" value="${pageScope[pageScope.collection_name]}" />
</c:when>
<c:when test="${scope == 'request'}">
<c:set var="ck_options" value="${requestScope[pageScope.collection_name]}" />
</c:when>
<c:when test="${scope == 'session'}">
<c:set var="ck_options" value="${sessionScope[pageScope.collection_name]}" />
</c:when>
<c:when test="${scope == 'application'}">
<c:set var="ck_options" value="${applicationScope[pageScope.collection_name]}" />
</c:when>
<c:otherwise>
<c:out value="collection scope not defined properly in check_boxes widget!" />
</c:otherwise>
</c:choose>


<c:set var="ck_options_size" value="${ck_options.length}" />
<c:if var="ck_options_size" test="${(pageScope['index']+1)}">
<c:set var="colspan" value="${(pageScope['index']+1)%pageScope['per_row']}" />
<c:out value="${colspan}" />
</c:if>
>


From: Wendy Smoak <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
To: Struts Users Mailing List <user@struts.apache.org>
Subject: Re: [OT] JSTL + Collection size
Date: Thu, 28 Apr 2005 16:39:52 -0700

From: "draegoon Z" <[EMAIL PROTECTED]>

> Just trying to find the ${my_collection.size} or ${my_collection.length}!
> Why is it not that simple?


Unfortunately, the Collection interface only has a 'size' method, not the
'getSize' that would be required for what you wrote to work.

What are you trying to do?  Maybe there's another way to get it done.  IOW,
why do you need the size?

--
Wendy Smoak


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to