Search This Blog


Thursday, March 26, 2015

Beware of the NullReferenceException when executing a ParametrizedAction with TabbedMDI in v14.2.6

I would like to pay your attention to the ParametrizedAction throws the NullReferenceException when TabbedMDI is used issue, which you may encounter in the version 14.2.6

Turning off the tabbed MDI mode can temporarily help you avoid this error, but this is not very suitable. So, I strongly recommend you download a patch from here.

Please accept sincerely apologies from our team for all the inconvenience here.

Wednesday, March 25, 2015

Save & Close again: To close, or not to close: that is the question - YOUR FEEDBACK IS NEEDED!

Just a quick help request to you, guys...
There was one point regarding the behavior described in my recent post at
Corrected Save & Close Action behavior on the Web in v15.1, which we were not very sure about:

#2. If the DetailView was first opened in the View mode from a root ListView, then switched to the Edit mode by an end-user via the Edit Action, then Save & Close will save the changes and return you back to the View mode instead of closing and showing the source ListView.

We received only a couple of comments on this very point and since this change is not very important to us, we wanted to make sure the new behavior meets the needs of the most users. So, I would kindly ask you take a minute to leave a comment to my blog post on the desired behavior you would like to see in this situation. Thank you in advance!

I personally tend to think that this should be a real "close" result = navigating back to the ListView regardless the DetailView was in the View mode before or not. But you may disagree and consider this as navigating back to the previous view state in the stack...who knows...

Determining whether a security user belongs to a certain role in code becomes a bit easier

As you probably know, we already have a built-in solution for checking this condition within criteria - IsCurrentUserInRole criteria function (learn more from my blog...).
Doing the same in C# or VB.NET code is also possible with LINQ or a simple 'foreach' (through the SecuritySystem singleton), it would still be great to have a more straightforward and built-in method for this common task, especially for newbies.

Good news is that starting with version 14.2.7, this task can be done more easily. Let me quote the provided solution details from this Support Center thread:

Now, you can determine whether a user belongs to a certain role in code using the IsUserInRole extension method. This method is available for both ISecurityUserWithRoles (new Security System) and IUserWithRoles (legacy Security System) user types.

Tuesday, March 24, 2015

Google Maps integration in XAF Web UI - Looking for real use-cases!

We had a few requests from our users on this subject, and some time ago we described two possible integration options (a custom ListEditor and PropertyEditor) in the T195734: How to use Google Maps in XAF ASP.NET application ticket. There is nothing special here as these approaches are already well-known from XAF documentation: Using a Custom Control that is not Integrated by Default

In addition to the implementation instructions, there was a sample project that should have helped you get all the pieces of the puzzle together. It was not complete implementation by any means (some scenarios were not implemented intentionally), but rather a demonstration of how that is possible in general with an intent for users to further extend and test this solution according to your exact business requirements and Google Maps API docs :-).

Unfortunately, there was not much interest and feedback from users on this basic implementation and, more importantly, on their business requirements, nor on the info on how the Google Maps component helps end-users do their work easier. We require this essential information in order to investigate whether or not it is possible to provide a universal and useful solution for this scenario as part of the standard framework delivery.

This blog post is one more attempt to collect this information from you, guys, I greatly appreciate your input in advance. I am also writing this because I've recently extended the original example implementation by supporting a few more things, which I think the majority would want to have by default. These are: opening geo point details in DetailView after clicking on it within a a map, the possibility to not only display a point's information in detail form, but also to edit its details when we are in the Edit mode with the help of ASPxObjectPropertyEditor. I demonstrated the latest features in the video below:

Unable to display content. Adobe Flash is required.

If you faced a requirement to use Google Maps or any other similar map control to better meet the needs of your clients, I would greatly appreciate it if you email me at and tell the details of your real use-cases along with the screenshots, videos and other info. 
To formalize this a bit and make it easier for you to answer (and for us to process too), see the four simple points:

Thursday, March 19, 2015

Making sure a property value is unique with XAF and XPO

I wanted to share a link to a hot Support Center discussion on the subject with the community members as I believe this business task is not unique:-) and many others should be interested in knowing how to properly handle this.
I am going to detail technical considerations of possible solutions at the application UI and database levels depending on various configurations of your data model including inheritance mapping options (Table per Hierarchy or Table per Type) and soft deletion.

Application UI level

First of all, let's start from the UI part. How would a developer of an XAF app ensure that its end-users are not allowed to save records whose property value or combination of values are unique? 
As you know, XAF ships with a built-in validation module that provides a powerful and extendable validation engine and a large set of predefined attributes to configure common validation rules declaratively. To ensure uniqueness, you can first add the ValidationModule component into your XAF module or application via the designers and then choose from the two built-in rules: RuleCombinationOfPropertiesIsUnique and RuleUniqueValue (it is also possible to turn RuleObjectExists and RuleFromBoolPropert for the same task, but its use is not that straightforward use and I will not talk about it for now). Depending on your preferences, you can either annotate your data model classes with the corresponding code attributes, e.g.:


       public string Name { ... }

or declare everything at the Application Model level via the Model Editor tool (learn more...). In addition, you can configure the rule's CriteriaEvaluationBehavior parameter, to specify whether to look for modified objects that are currently loaded in memory, in addition to objects in the database itself.
As a result, the XAF's validation engine will consider the rules you configured  when a data record is being saved (technically, when the View.ObjectSpace.Committing event is raised) and will throw ValidationException when uniqueness is violated. This is a special exception type, which is caught by other system controllers to display the validation error in a nice way in the UI:

This would be our topmost  or basic protection level as it handles user input only. It will not help avoid duplicates if the same data records are created in code by a developer who did not call one of the Validator.RuleSet.ValidateXXX methods.