struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wendy Smoak <Wendy.Sm...@asu.edu>
Subject RE: Checkbox not checked
Date Wed, 18 Feb 2004 15:38:06 GMT
> From: Curtis Taylor [mailto:c.tee@verizon.net] 
> 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...;-)

No, that part is working fine.  'item.value.activity' is a Map of
Booleans, and I'm checking whether there's any activity for that
calendar year.

The problem is that this:
   <html-el:checkbox property="accounts" value="${item.key}"/> 
does not render as "checked" when the matching value _is_ present in the
String[] property called 'accounts' in the form bean. :(

I think it has to do with manually supplying the 'value', because it
works if you do this:
<c:forEach items="${accountForm.map['accounts']}" var="acct" >
    <html-el:multibox property="accounts" value="${acct}"/>
    <c:out value="${accountMap[acct].costCenterDesc}"/>
</c:forEach>

I could just hit delete now, but instead I'll archive my mistake:  I
used checkbox with a String[] property.  The second snippet has the
correct tag: multibox.  Which is why that one works.

-- 
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


Mime
View raw message