struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jakub Milkiewicz" <jmilkiew...@gmail.com>
Subject complex validation problem.
Date Sun, 23 Apr 2006 10:46:02 GMT
Hi
I have a problem with conditional validation. Currently i am working with
struts 1.1 - because of its WSAD support but i am thinking of migrating to
the newest one.
My problem is that on my jsp page i have 2 radio buttons:
<html:radio name="viewBean"  property="documentIdentity" value="dowod"/>
<html:radio name="viewBean"  property="documentIdentity" value="paszport"/>
I am using struts validator and in my validation.xml i want to have
passportNumber property validated IF AND ONLY IF documentIdentity equals
paszport.
More, i want to have it validated with other validators too.
I need something like:
<field property="passportNumber"
             depends="requiredif,mask" page="1">
                 <var>
                      <var-name>field[0]</var-name>
                        <var-value>documentIdentity</var-value>
                      </var>
                      <var>
                        <var-name>fieldTest[0]</var-name>
                        <var-value>EQUAL</var-value>
                      </var>
                      <var>
                        <var-name>fieldValue[0]</var-name>
                        <var-value>paszport</var-value>
                      </var>
                      <var>
                       <var-name>mask</var-name>
                       <var-value>${passportNumberMask}</var-value>
                     </var>
        </field>
So if documentIdentity.equals paszport, passportNumber  is required and
needs to be validated against mask validator.
If doucmentIdentity eqauls dowod, i do not wanna to validate passportNumber
at all.
Can struts validator satisfy my requirements? Can struts 1.1 validator
satisfy it??
I have spent a lot of time on struts mailing list trying to find an answer
for my problem but i haven't found anything special.
Maybe solution presented in
http://marc.theaimsgroup.com/?l=struts-user&m=113029818225923&w=2
is suggested in Struts.
Can anyone help me.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message