Search This Blog

Tuesday, November 20, 2012

Controlling the size of popup windows on the Web

As you probably know, it is possible to control the size of Web popup windows in code (btw, would not it be nice to control this via the application model as well?) or end-users can perform resizing themselves. Starting with 12.2, end-users will also be able to quickly maximize the popup window using the familiar interface. Let's see the attached video for more details:

MaximizeWebPopupWindows.swf Download this file

In this particular case, all kudos go to our ASP.NET team, because they have improved the ASPxPopupControl component in 12.2 and my work was to just enable a single option by default and ensure that it operates correctly in XAF Web UI. I hope you are looking forward to the 12.2 release!

Monday, November 19, 2012

Getting started with EasyTest (lazy man tutorial)

If you are not using our functional testing framework  - EasyTest yet (if you fall into this category, do not feel bad as you are not alone - our stats (example) show that you are still in the majority:-) ), then this is a good chance to start!

I would like to talk about an internal *AutoTest command that we use to test XAF Code Examples during the initial testing phase internally (before running example-specific tests). This command checks all the navigation items in your app and ensures that list and detail forms can be opened without errors. Not much, but at least it allows you ensure the minimal possible quality of your application before delivering it to the client. Of course, if you wish more, you can choose from dozens of other built-in EasyTest commands or even implement a custom EasyTest command with blackjack and ..., you know:-)

BTW, creating a custom EasyTest command is not that difficult at it appears, expecially taking into account the detailed tutorial and the availability of the full source code of the built-in EasyTest commands:
%ProgramFiles%\DXperience 12.1\Sources\DevExpress.ExpressApp.Modules\DevExpress.ExpressApp.EasyTest.WinAdapter\
%ProgramFiles%\DXperience 12.1\Sources\DevExpress.ExpressApp.Modules\DevExpress.ExpressApp.EasyTest.WebAdapter\
Well, returning to simple things, this is how to use the command I was talking about:
#Timeout 10
#DropDB SimpleProjectManager
#Application SimpleProjectManagerWin
;#Application SimpleProjectManagerWeb
You can past this stuff (correct app names first, of course!) into the <YourSolutionName>.Module\FunctionalTests\Sample.ets file (it comes with the default XAF solution template) and then right click to choose the Run command in the menu (see this help article for more details).
And here is the result it produces:

View on »
Seriously, it is time to start with EasyTest, no more excuses;-)

As I mentioned in the beginning, this command is internal and unofficial. We also have not tested it under all scenarios supported by XAF. That said, we may not be able to fix issues with it in a reasonable time frame, so please use it at your own risk, and feel free to modify and test it further to better meet your business requirements.risk. Or better implement normal functional tests for each required screen in your app using the wonderful EasyTest Script Reference.

Some usability improvements to the BO Designer

Some of you will probably be interested in knowing that the BO Designer will have a few usability improvements in version 12.2. I have summarized what I have recently implemented to the designer in this short video:

View on »

Hope you like it.

Friday, November 2, 2012

System.Type of DC interfaces vs registered business entities

If you are using Domain Components (DC), you may be already aware of the fact that XAF generates real business entities from registered DC interfaces at runtime. If you have a code that checks types of the current object (e.g., you want to do something only if the current object is of YourBusinessEntityType), you should take this important fact into account, otherwise it may lead to an error, which is quite easy to diagnose, though. A good example of this can be found in this Support Center ticket (which actually forced me to blog about this):

using DevExpress.ExpressApp.DC;
using DevExpress.ExpressApp.Xpo;
private void checkType_Execute(object sender, SimpleActionExecuteEventArgs e)
            foreach (object current in View.SelectedObjects)
                /* This is wrong, because real types are generated at runtime based on registered DCs.
if (current.GetType() == typeof(DomainComponent1)) 
                //The next three variants are good to go.
                //if (typeof(DomainComponent1).IsAssignableFrom(current.GetType()))
                //if (current.GetType() == ((IDCEntityStore)XafTypesInfo.PersistentEntityStore).GetGeneratedEntityType(typeof(DomainComponent1)))
                if (current.GetType() == XpoTypesInfoHelper.GetXpoTypeInfoSource().GetGeneratedEntityType(typeof(DomainComponent1)))

As you can see, DC provides you with a method that returns the generated runtime type. Also, the type of the generated entity supports or implements DC interfaces used to form this entity, so you can use the System.Type.IsAssignableFrom method here.
I hope you find this information helpful.

Thursday, November 1, 2012

It's not a bug, it's a feature!

Are you aware of this "hidden" feature of the XAF Tabbed MDI interface?:-)
If not, it is never late to learn! In addition, I suggest you review one more help article that describe other hidden goodies. I hope you find this information helpful.

View on »