I am trying to use validwhen with html multibox in
struts tag.
In my JSP I am using
a) a html:multibox which renders 4 check boxes for me
(using iterate tag). 
In my actionform this multibox property stores values
to a "String Array" property name "reasons" 
and
b) a text field of property name "dispatch"
�- this textfield "dispatch" will have only 2 string
values 
�Either� "process" or "reject" (assume it gets
dynamically assigned these String values)

all i want to do is that to ensure
no checkboxes are checked when the text field
dispatch=="process"
and
All (or) atleast one check box is checked when
dispatch=="reject"

I am aware of some integer comparison bug with 1.2.4
while using validwhen.
now am using 1.2.5 but none of my combinations seem to
work.
One of the combinations I tried is below mentioned.
This nearly works but does not ensure the checkboxes
are checked when dispatch=="reject"
<field property="reasons"
indexedListProperty="reasons" depends="validwhen"
page="1" >
<arg key="error.reasons.input" position="0" />
<var>
<var-name>test</var-name>
<var-value>(((dispatch == "process") and (*this* ==
null)) or ((dispatch == "reject") and (*this* !=
null)))</var-value>
</var>
</field>
�
NOTE: for some reason when I submit these 4 checkboxes
"UNCHECKED", they seem to be *NOT* NULL. They get
initialized to a zero length array. I am not
initializing the "reasons" property in the
struts-config.xml. So this property must be
initialized to null, which happens all fine. But when
empty unchecked check boxes are submitted the
"reasons" property is no more null but a zero length
array.
�
I would really appreciate if someone can just reply me
with a solution.
�
Many thanks in advance.



        
        
                
___________________________________________________________ALL-NEW Yahoo! Messenger - 
all new features - even more fun! http://uk.messenger.yahoo.com

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

Reply via email to