Project

General

Profile

User story #3954

Updated by François ARMAND about 11 years ago

We want to be able to say that a field is optionnal if and only if an other field has some value.  

 In particular, we want to be able to say "that field MUST BE defined if the checkbox is checked".  

 I think that a new constraint like: 

 <pre> 
     

     <MAYBEEMPTY_IF field="full.qualified.name.of.field.to.test">Some[text]with?regexallowed</MAYBEEMPTY_IF> 
 </pre> 

 could run.  

 It shoudl be sufficient, in that first user story, to not provide <maybe empty if not> (the negation of the proposed constraint) because Java regex, the one that we are going to use, are pcre-compatible and allow negation (with somthing like "not matching WORD" with the rexep: ((?!WORD).)* , see http://stackoverflow.com/questions/406230/regular-expression-to-match-string-not-containing-a-word )

Back