|
From: Benoit X. <bx...@ob...> - 2008-02-08 16:49:45
|
Hi All,
It is Friday afternoon and my brain is slowing down. What would be the best
way to say:
If Property X == 'VAL_1' then Property Y must be ABSENT/null
If Property X == 'VAL_1' then Property Z must be ABSENT/null
If Property X == 'VAL_2' then Property Y is required
If Property X == 'VAL_3' then Property Z is required
The last 2 are easy:
add(new RequiredIfTrue("Y", eq("X", "VAL_2")));
add(new RequiredIfTrue("Z", eq("X", "VAL_3")));
but something like AbsentIfTrue would be useful.
But how would you check for absence? Not(present("Y")) ?
Second question, is it possible to put a rule with a given regular
expression (like ISIN which are 2 char followed by 9 numerics).
Many thanks,
Benoit
------------------------------
IMPORTANT NOTICE
This communication contains information that is considered confidential and
may also be privileged . It is for the exclusive use of the intended
recipient(s). If you are not the intended recipient(s) please note that any
form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful. If you have
received this communication in error please return it to the sender and
delete the original.
|
|
From: Jan H. <jh...@sc...> - 2008-02-11 07:06:05
|
Have you tried something like:
constraints.ifTrue(constraints.eq("X", ValueY),
constraints.not(constraints.present(Y)));
Maybe we should indeed add an AbsentIfTrue as an opposite of the
RequiredIfTrue.
Kind Regards,
Jan
On Fri, 2008-02-08 at 16:44 +0000, Benoit Xhenseval wrote:
> Hi All,
>
>
>
> It is Friday afternoon and my brain is slowing down… What would be
> the best way to say:
>
>
>
> If Property X == ‘VAL_1’ then Property Y must be ABSENT/null
>
> If Property X == ‘VAL_1’ then Property Z must be ABSENT/null
>
> If Property X == ‘VAL_2’ then Property Y is required
>
> If Property X == ‘VAL_3’ then Property Z is required
>
>
>
> The last 2 are easy:
>
> add(new RequiredIfTrue("Y", eq("X", “VAL_2”)));
>
> add(new RequiredIfTrue("Z", eq("X", “VAL_3”)));
>
>
>
> but something like AbsentIfTrue would be useful…
>
> But how would you check for absence? Not(present(“Y”)) ?
>
>
>
> Second question, is it possible to put a rule with a given regular
> expression (like ISIN which are 2 char followed by 9 numerics).
>
>
>
> Many thanks,
>
>
>
> Benoit
>
>
>
> ------------------------------
>
> IMPORTANT NOTICE
>
> This communication contains information that is considered
> confidential and may also be privileged . It is for the exclusive use
> of the intended recipient(s). If you are not the intended recipient(s)
> please note that any form of distribution, copying or use of this
> communication or the information in it is strictly prohibited and may
> be unlawful. If you have received this communication in error please
> return it to the sender and delete the original.
>
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________ Springframework-rcp-dev mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-rcp-dev
**** DISCLAIMER ****
http://www.schaubroeck.be/maildisclaimer.htm
|
|
From: Geoffrey De S. <ge0...@gm...> - 2008-02-11 09:14:49
|
Maybe it's better to disable (and clear) the field if the other property
is true?
With kind regards,
Geoffrey De Smet
Jan Hoskens schreef:
> Have you tried something like:
>
> constraints.ifTrue(constraints.eq("X", ValueY),
> constraints.not(constraints.present(Y)));
>
> Maybe we should indeed add an AbsentIfTrue as an opposite of the
> RequiredIfTrue.
>
> Kind Regards,
> Jan
>
>
> On Fri, 2008-02-08 at 16:44 +0000, Benoit Xhenseval wrote:
>> Hi All,
>>
>>
>>
>> It is Friday afternoon and my brain is slowing down… What would be
>> the best way to say:
>>
>>
>>
>> If Property X == ‘VAL_1’ then Property Y must be ABSENT/null
>>
>> If Property X == ‘VAL_1’ then Property Z must be ABSENT/null
>>
>> If Property X == ‘VAL_2’ then Property Y is required
>>
>> If Property X == ‘VAL_3’ then Property Z is required
>>
>>
>>
>> The last 2 are easy:
>>
>> add(new RequiredIfTrue("Y", eq("X", “VAL_2”)));
>>
>> add(new RequiredIfTrue("Z", eq("X", “VAL_3”)));
>>
>>
>>
>> but something like AbsentIfTrue would be useful…
>>
>> But how would you check for absence? Not(present(“Y”)) ?
>>
>>
>>
>> Second question, is it possible to put a rule with a given regular
>> expression (like ISIN which are 2 char followed by 9 numerics).
>>
>>
>>
>> Many thanks,
>>
>>
>>
>> Benoit
>>
>>
>>
>> ------------------------------
>>
>> IMPORTANT NOTICE
>>
>> This communication contains information that is considered
>> confidential and may also be privileged . It is for the exclusive use
>> of the intended recipient(s). If you are not the intended recipient(s)
>> please note that any form of distribution, copying or use of this
>> communication or the information in it is strictly prohibited and may
>> be unlawful. If you have received this communication in error please
>> return it to the sender and delete the original.
>>
>>
>>
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________ Springframework-rcp-dev mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-rcp-dev
>
>
> **** DISCLAIMER ****
> http://www.schaubroeck.be/maildisclaimer.htm
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Springframework-rcp-dev mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-rcp-dev
|