struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian "Alcÿffffe1ntara" <christianalcant...@yahoo.com>
Subject problems using requiredif
Date Thu, 17 Jun 2004 16:03:06 GMT
Hi,

I have some problem using requiredif, the problem is
the following:

I have 1 Dynamic form and two JSPs that send
information (these JSPs differs in any fields) two one
action, I'm trying to get that depends on the value of
one field (tipPersona = 0/1)require and mask any
fields.  this works with one field(txtRazonSocial) but
with other(codActividadEconomica) always get a mask
error.

here's the code:


<field property="tipPersona" depends="required,mask">
            <arg0 key="${var:campo}" resource="false"
name="required" />
            <arg0 key="${var:campo}" resource="false"
name="mask" />
                <var>
                    <var-name>campo</var-name>
                    <var-value>Tipo de
Persona</var-value>
                </var>
                <var>
                    <var-name>mask</var-name>
                    <var-value>^[01]{1}$</var-value>
                </var>
            </field>

<field property="txtRazonSocial"
depends="requiredif,mask">
            <arg0 key="${var:campo}" resource="false"
name="mask" />
            <msg name="requiredif"
key="errors.required"/>
            <arg0 key="${var:campo}" resource="false"
name="requiredif" />
                <var>
                    <var-name>campo</var-name>
                    <var-value>Razón
Social</var-value>
                </var>
                <var>
                    <var-name>mask</var-name>
                    <var-value>^[a-zA-Z09
\-]{2,70}$</var-value>
                </var>
                <var>
                    <var-name>field[0]</var-name>
                    <var-value>tipPersona</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>0</var-value>
                </var>
            </field>

<field property="codActividadEconomica"
depends="requiredif,mask">       
                <arg0 key="${var:campo}"
resource="false" name="mask" />
                <msg name="requiredif"
key="errors.required"/>
                <arg0 key="${var:campo}"
resource="false" name="requiredif" />
                <var>
                    <var-name>field[0]</var-name>
                    <var-value>tipPersona</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>0</var-value>
                </var>
                <var>
                    <var-name>mask</var-name>
                    <var-value>^[0-9]{2}$</var-value>
                </var>
                <var>
                    <var-name>campo</var-name>
                    <var-value>Actividad
Económica</var-value>
                </var>
            </field>
<field property="txtApellidoMaterno"
depends="requiredif,mask">
            <arg0 key="${var:campo}" resource="false"
name="mask" />
            <msg name="requiredif"
key="errors.required"/>
            <arg0 key="${var:campo}" resource="false"
name="requiredif" />
                <var>
                    <var-name>campo</var-name>
                    <var-value>Apellido
Materno</var-value>
                </var>
                <var>
                    <var-name>mask</var-name>
                    <var-value>^[a-zA-Z
\-]{2,30}$</var-value>
                </var>
                <var>
                    <var-name>field[0]</var-name>
                    <var-value>tipPersona</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>1</var-value>
                </var>
            </field>

Inside JSP I only have the properties that are
validated when the value of tipPersona=1, I didn't the
other page because i want to be sure that it works.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message