I am having some strange behaviour with a checkbox.

if I use:

<s:checkbox name="emailAddresses[${loop.index}].canLogin" value="true" />

everything works great.  It accesses the relevant values in the list and
shows them and I can set them

If I use:

<s:checkbox name="emailAddresses[${loop.index}].canLogin" value="true"
disabled="disabled"/>

it works fine as well.  It reads the values and sets the checkbox
accordingly as well as disabling it.

But if I try to make the disabling conditional it doesn't work.  I have
tried:

<s:checkbox name="emailAddresses[${loop.index}].canLogin" value="true"
disabled="${actionBean.viewOnly}"/>

In this case when disabled is on the correct value is shown in the check box
but when it is not disabled it always shows unchecked.

So I tried

<c:choose>
    <c:when test="${actionBean.viewOnly}">        
        <s:checkbox name="emailAddresses[${loop.index}].canLogin"
value="true" disabled="disabled"/>
    </c:when>
    <c:otherwise>
        <s:checkbox name="emailAddresses[${loop.index}].canLogin"
value="true"/>
    </c:otherwise>
</c:choose>

but strangely enough I got the same wrong result.  I realy don't want to
split this jsp into multiple jsps.

Any ideas?

Thanks

-- 
View this message in context: 
http://old.nabble.com/problem-with-conditional-disabled-attribute-on-checkbox-tp26697251p26697251.html
Sent from the stripes-users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to