Blogs

eXpress App Framework Team

Sneak peek: collection validation in XAF v2009 vol 2 (eXpressApp Framework)

     

Just a very quick look at a new feature in v2009 vol 2 of XAF. This is very early stuff, I hear the beta won't be along before the end of June.

We have added the ability to apply rules to collection properties. For instance, in this screenshot you can see a rule failing that is defined to check against the sum of values over the collection. The values in the field "Sum between 0 and 50" are supposed to add up to 50 at most, but since the sum is actually 60, the rule triggers a validation error.

Here's another example. In the "lowest" of the three stacked windows, you can see a collection of objects with a field called "Item Unique Value". The rule that is applied to the collection checks whether the field values are unique across the entire collection. When the detail view is brought up and the second item is edited to have the same value in that field as the first object, the rule triggers a validation error.

Published Jun 11 2009, 03:37 PM by Oliver Sturm (DevExpress)
Filed under: ,
Technorati tags: XAF, v2009.2
Bookmark and Share

Comments

 

Alain said:

Just great!.

Can you post the syntax of the RuleAttribute?

Regards

June 11, 2009 11:18 AM
 

Boris Bosnjak said:

Great stuff!

June 11, 2009 12:45 PM
 

Alberto Cortes said:

Great!, I need it just now! :-)

June 11, 2009 2:47 PM
 

Oliver Sturm (DevExpress) said:

Alain,

For the first demo, the rule I described looks like this in code:

[RuleRange("RuleRangeObject.Collection_RuleRange2", DefaultContexts.Save, 0, 50, TargetPropertyName = "SumBetween0And50", TargetCollectionAggregate = Aggregate.Sum, CustomMessageTemplate = @"The sum of the ""{TargetPropertyName}"" values must be within ""{MinimumValue}"" and ""{MaximumValue}"" range. The current value is ""{AggregatedTargetValue}""")]

The second example is based on a specific rule type, so the attribute just looks like this:

[RuleUniqueValue("UniqueValue1", DefaultContexts.Save, TargetPropertyName = "ItemUniqueValue")]

June 12, 2009 4:57 AM
 

E3i Tecnologia Ltda said:

Hi Oliver,

This will not be avaliable for Web, correct? BTW, great stuff...

June 15, 2009 6:08 PM
 

Oliver Sturm (DevExpress) said:

Rodrigo -

Oh, this is absolutely available on the web! Our validation functionality is exactly the same across UI platforms.

June 16, 2009 4:10 AM
 

Steven Rasmussen said:

Just a suggestion but you may want to put tags on this post (XAF, 2009.2, etc).

July 2, 2009 11:16 PM
 

ctodx said:

We're just about to release v2009.2 and it would be a good idea to have an "accumulator"

August 20, 2009 8:29 PM
More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.