You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Wendy Smoak <We...@asu.edu> on 2004/02/17 23:42:42 UTC
Checkbox not checked
(No, this isn't the infamous "how do I uncheck my checkbox" question!)
I have this:
<c:forEach items="${accountMap}" var="item" >
<c:if
test="${item.value.activity[accountForm.map.calendarYear]}">
<html-el:checkbox property="accounts" value="${item.key}"/>
<c:out value="${item.key}"/>
<c:out value="${item.value.costCenterDesc}"/>
</c:if>
</c:forEach>
Unfortunately, the checkboxes corresponding to the String[] 'accounts'
property of the form are not being rendered as checked.
Before I go back to the Action and create a separate Map to hold only
the "active" accounts based on the selected year, does anyone think this
ought to work the way it is?
--
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Checkbox not checked
Posted by Curtis Taylor <c....@verizon.net>.
Hi Wendy,
I'm not exactly sure, but I'm a tad suspect of your 'c:if test' expression. It
looks suspiciously like a Python "boolean" test for the object's presence.
AFAIK, in JSTL one needs to be more explicit as to what value (or lack thereof)
when testing...
Unless, of course, it's just a typo in your email...;-)
Curtis
--
c dot tee at verizon dot net
Wendy Smoak wrote:
> (No, this isn't the infamous "how do I uncheck my checkbox" question!)
>
> I have this:
> <c:forEach items="${accountMap}" var="item" >
> <c:if
> test="${item.value.activity[accountForm.map.calendarYear]}">
> <html-el:checkbox property="accounts" value="${item.key}"/>
> <c:out value="${item.key}"/>
> <c:out value="${item.value.costCenterDesc}"/>
> </c:if>
> </c:forEach>
>
> Unfortunately, the checkboxes corresponding to the String[] 'accounts'
> property of the form are not being rendered as checked.
>
> Before I go back to the Action and create a separate Map to hold only
> the "active" accounts based on the selected year, does anyone think this
> ought to work the way it is?
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org