tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wendy Smoak <j...@wendysmoak.com>
Subject Re: combining tags
Date Wed, 06 Jul 2005 16:13:05 GMT
From: "Tom Holmes Jr." <tom@tomholmes.net>

> I'd like to switch to something likes this:
> <c:forEach items="${SelectedRoomsForm.roomsList}" var="data"
> varStatus="status">
>         <html:checkbox name="data" property="checkedRes" indexed="true"/>
>         <c:out value="${data.roomType}"/>
>        <html:text name="data" property="numItems" indexed="true"
> style="width:40"/>
> </c:forEach>
>
> The <c:out> tag I am sure works, but I am not sure about the
> <html:checkbox> or the <html:text>
>
> Does this code look ok, or is there something I have to change?

Assuming you're not on a JSP 2.0 container (I assume not, or you wouldn't be
using <c:out>) you might want to switch to the Struts-EL tags instead of the
'classic' taglib.  With the ability to use expressions in the JSTL tags,
you'll quickly get frustrated at NOT being able to do it in the Struts tags.

Indexed tags are now supported within <c:forEach> loops, according to the
README.txt file included with Struts-EL.  To switch over, look in the
'contrib' directory of the Struts 1.2.7 distribution, get the .jar files and
change to:
     <%@ taglib uri="http://struts.apache.org/tags-html-el" prefix="html-el"
%>
(Some people leave the prefix as 'html'.)

All my checkboxes-within-forEach-loops are 'multibox' not 'checkbox'.  But I
don't use indexed properties, so YMMV.

-- 
Wendy Smoak


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message