Hello,

We have had problems using struts "validwhen" validator with jdeveloper
10g all last week. Traditionally jdeveloper 10g is shipped with struts
1.1 but after reading that "validwhen" is what we should be using
instead of "requiredif" we decided to plugin sturts 1.2.4 into jdev 10g
and this works fine.

Our problem is that we have a checkbox(ChangeAddredd) called "check here
to enter and change address". Once this is checked there are some
address fields that need to be entered. We want error messages to be
displayed when user enters address fields without checking the checkbox
and also vice versa. I understand that " Only two items may be joined
with and or or ". I tried using you suggestion elsewhere( you suggested
to use something like the following):

<!DOCTYPE form-validation PUBLIC
"-//Apache Software Foundation//DTD Commons Validator Rules
Configuration 1.1.3//EN "
"http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd " >
<form-validation>
  <formset>
    <form name="PF_Report_1_Bean">
      <field property="ChangeAddress" depends="validwhen">
        <msg name="validwhen"
key="validation.error.PF_Report_1.ChangeAddress"/>
        <var>
          <var-name>test</var-name>
          <var-value>
              ((*this* != null) OR 
              ((NameRev == null) AND
              ((Address1Rev == null) AND
              ((CityRev == null) AND
               (ZipcodeRev == null)
              )
              )
              )
              )
        </var-value>
        </var>
      </field>
      <field property="NameRev" depends="validwhen">
        <msg name="validwhen"
key="validation.error.PF_Report_1.NameRev.miss"/>
        <var>
          <var-name>test</var-name>
          <var-value>((*this* != null) OR (ChangeAddress ==
N))</var-value>
        </var>
      </field>
      <field property="Address1Rev" depends="validwhen">
        <msg name="validwhen"
key="validation.error.PF_Report_1.Address1Rev.miss"/>
        <var>
          <var-name>test</var-name>
          <var-value>((*this* != null) OR (ChangeAddress ==
N))</var-value>
        </var>
      </field>
      <field property="CityRev" depends="validwhen">
        <msg name="validwhen"
key="validation.error.PF_Report_1.CityRev.miss"/>
        <var>
          <var-name>test</var-name>
          <var-value>((*this* != null) OR (ChangeAddress ==
N))</var-value>
        </var>
      </field>
      <field property="ZipcodeRev" depends="validwhen">
        <msg name="validwhen"
key="validation.error.PF_Report_1.ZipcodeRev.miss"/>
        <var>
          <var-name>test</var-name>
          <var-value>((*this* != null) OR (ChangeAddress ==
N))</var-value>
        </var>
      </field>
    </form>
  </formset>
</form-validation>


Reply via email to