cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brent Johnson <>
Subject Modifying Attributes in JXTemplate
Date Wed, 13 Apr 2005 13:27:21 GMT
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

<jx:forEach items="${types}" var="${type}">
        <jx:when test="${type.isChecked()}">
            <input type="checkbox" name="type" value="${type.getId()}"
            <input type="checkbox" name="type" value="${type.getId()}"/>

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>


- Brent

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message