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
[EMAIL PROTECTED]                              http://www.mobilebox.pl

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to