Search This Blog


Friday, January 15, 2016

How to remove or hide the base class from the New Action's items list

We have recently written a short article describing several methods of accomplishing a popular business model design task, which generated support calls in the past. Some things may already be known to you (e.g., the fact that in XAF you can control many things at the data model class and Controller level), but others are worth repeating, and I hope you will find this article helpful:

As always, I look forward to hearing your feedback in comments to this blog post. Thanks in advance.

Wednesday, January 13, 2016

StateMachine - Simplifying the structure of the ChangeState Action - YOUR FEEDBACK IS NEEDED


At the moment, the ChangeState Action always provides the "Change status to" menu item holding actual state items:

However, it may be easier for end-users to avoid this intermediate menu group. What do you thin?

Solution & Questions

I have just described a possible technical solution in the corresponding Support Center thread and wanted to hear from you on it:

Q1: Would you like to enable the proposed transformation for a single menu group by default?

Q2: Which PlainMenuForMultipleMachines option default value would you prefer?

True (1-level menu with group separators)


False (2-level menu):

Wednesday, December 30, 2015

EF - Use of complex types that are not registered in DbContext and have no key property

I want to highlight a minor usability improvement built into v15.2 for our Entity Framework fans. This is all about a simpler integration of complex types without keys (learn more from EF docs...). 

The situation is already pretty much summarized in the Support Center, and here I just want to re-post the main details. To begin with, consider the following EF classes:

public class Product { public Product() { PriceRange = new Range(); } public Int32 ID { get; set; } public String Name { get; set; } public Range PriceRange { get; set; } } public class Range { public Range() { } public Decimal Low { get; set; } public Decimal High { get; set; } }
public class EFDemoDbContext : DbContext {
    public DbSet<Product> Products { get; set; }

Note that the Range class has no key property and Entity Framework does not map this class to a separate database table. By default, properties of such a class persist in the table mapped to the parent Product class, where the Range type property is declared. So, the Product table will have the ID, NamePriceRange_Low and PriceRange_High columns:

Wednesday, December 23, 2015

The GetObjectsNonReenterant error for security permissions with complex criteria - Fixed in v15.2.5

In v15.2.5 we have made improvements at both the XPO and XAF levels to avoid the Entering state 'GetObjectsNonReenterant' from state 'CommitTransactionNonReenterant, CommitChangesToDataLayer' is prohibited due to state 'CommitChangesToDataLayer' error that might occur while evaluating security permission criteria involving collections during the object saving procedure (S170995). Our previous attempt was unsuccessful and I apologize for this and all the inconvenience this has caused you and your business.

Our new low-level solution does not require extra options on your side, and I invite you to test a new 15.2 build containing these improvements: 

I am looking forward to hearing from you on how these improvements work in your real projects after installing this build and running the Project Converter tool. Thanks in advance!

Tuesday, December 22, 2015

MediaDataObject - Declaring images as object references instead of byte array

In v15.2 we have introduced the new MediaDataObject business class. The use of this type mainly reduces traffic in Web apps because images are cached in the browser cache (compared to images declared as byte[]).  

We have invented this solution when optimizing the new Web style performance on mobile devices. 
For instance, in our XCRM demo application (installed to C:\Users\Public\Documents\DevExpress Demos 15.2\Components\eXpressApp Framework\XCRM\, by default) the avatar picture in the top right corner is implemented using MediaDataObject:

Both WinForms and ASP.NET Image Property Editors are used automatically for properties of the MediaDataObject type, the delayed loading is also always enabled - no special attributes are required for this. However, you still can apply the ImageEditorAttribute to customize the editor's options. 

XPO and EntityFramework versions of this type are available in the Business Class LibraryRefer to the eXpressApp Framework > Concepts > Business Model Design > Data Types Supported by built-in Editors > BLOB Image Properties article to see example property declarations for your favorite ORM.