struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthieu MARC <matthieu.m...@angers.ensam.fr>
Subject Multiple fields validation
Date Wed, 28 May 2008 05:31:44 GMT
Hi,

I have a question about field validation.

I made a form  using struts2 tags in which I use an iterator to make 
select control :

<s:iterator value="week.semaine">
        <s:label labelposition="top" label="%{displayName}" />
        <s:select name="week.semaine[%{index}].am" 
onchange="countHour();" id="am%{index}" label="matin" list="heures" 
value="%{am}" />
        <s:select name="week.semaine[%{index}].pm" 
onchange="countHour();" id="pm%{index}" label="apr├Ęs-midi" list="heures" 
value="%{pm}" />
</s:iterator>

The list "heures" is a treeMap like 0 -> 00:00, 15 -> 00:15, 30 -> 00:30 ...

All is ok. Now, I want to validate the fields to secure the application. 
And I do not want to make 14 validators which are identical.

Is it possible to use regex for a 'name' in 'field', like :

validators> 
    <field name="week.semaine*.[a|p]m"> 
        ...
    </field>  
</validators>

Thanks for help.

Cordialy,
 

-- 
Matthieu MARC
matthieu.marc@angers.ensam.fr



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


Mime
View raw message