XAF: Easy custom members (What’s New in 13.2)

XAF Team Blog
15 November 2013

With our next major release (13.2), we have simplified the manner in which you are able to add custom and computed fields to existing business models. The functionality is available to both developers and end-users.

Once beta 1 is released, you can explore this new custom member functionality by exploring the FeatureCenter solution located in the C:\Users\Public\Documents\DXperience 13.2 Demos\eXpressApp Framework\FeatureCenter\CS folder.

Design time

As you know, XAF already offered the ability to create non-calculated persistent fields at design time using the Model Editor. In 13.2, we’ve extended the Application Model with an Expression attribute as illustrated in the image below.

image

When the Expression attribute has a value, XAF will create a calculated member or it will default to the creation of a persistent member. Additionally, you can create a complex expression such as the Sum of another custom field as illustrated below.

image

By design, XAF will not display these custom fields in any view since they were created manually after the Application Model was generated.

Runtime

The great thing is that in 13.2, end-users can use the runtime version of the Model Editor to create custom members and extend the business domain as discussed in the previous section.

The image below illustrates where to locate the custom member in the Windows version of our FeatureCenter (same location for the web).

image

To invoke the runtime Model Editor, end-users can execute the Edit Model action.

image

You may also want to restrict Application Model modification to certain user groups. You can do that as illustrated below.

image

Developers can restrict end-users from creating custom members at runtime by setting the static ModelMemberRequiredCalculator.AllowPersistentCustomProperties to false.

The Web Runtime

To create a custom member for the web, you can use the Standalone Model Editor and edit the Model.xafml file located in the root of the web-site.

image

Custom members are in their first release (CTP) so we look forward to your feedback as we get it ready for the official release. Let me know what you think.


Related video: Calculated Fields Added at Runtime

Free DevExpress Products - Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We'll be happy to follow-up.
No Comments

Please login or register to post comments.