cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <lgaw...@apache.org>
Subject Re: Modifying Attributes in JXTemplate
Date Wed, 13 Apr 2005 13:29:27 GMT
Brent Johnson wrote:
> I dont know about anyone else, but I find myself having to do a lot of
> <jx:choose> entries just for doing things like using a "checked"
> attribute on an <option>.  This has become quite annoying.  Here's an
> example:
> 
> <jx:forEach items="${types}" var="${type}">
>     <jx:choose>
>         <jx:when test="${type.isChecked()}">
>             <input type="checkbox" name="type" value="${type.getId()}"
> checked="1"/>
>         </jx:when>
>         <jx:otherwise>
>             <input type="checkbox" name="type" value="${type.getId()}"/>
>         </jx:otherwise>
>     </jx:choose>
>     ${type.getName()}
> </jx:forEach>
> 
> Since the "checked" attribute shows a check mark no matter what value
> is in the checked attribute, the whole tag has to be specified twice
> in a <jx:choose>, the only difference being the checked attribute. 
> This is also the same for <options> tag and the selected attribute.
> 
> Is there a better way to do this?  There any plans, or is there a
> possibility for future enhancement to add something like:
> 
> <input type="checkbox" name="type" value="${type.getId()}">
>   <jx:attribute name="checked">${checkval}</jx:attribute>
> </input>
Yes there are plans but this is not that easy to implement as it looks like.

-- 
Leszek Gawron                                                 MobileBox
lgawron@apache.org                              http://www.mobilebox.pl

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message