Search This Blog

Thursday, September 15, 2016

How to provide a specific View layout for users of certain security roles

I would like to quickly promote a recent update to our old Code Example in the support database: https://www.devexpress.com/example=E274
I hope you find this solution helpful. Let me know in case of any questions, suggestions or share your experience with other XAFers on how you are doing a similar task at the moment. Thanks!

Scenario:
This example demonstrates how to show a custom View against a role of the currently logged user. Custom Views were created and customized through the Model Editor for each role separately. For more convenience, custom Views have a name of a role in the Id attribute. For instance: Contact_ListView_Administrators, Contact_DetailView_Administrators, Contact_ListView_Users, Contact_DetailView_Users, etc. You may consider a specific naming convention, for example, to add a role name to the end of the view name. Use User and Admin user names with empty password to login into the application.



Implementation details:
There is E274.Module\Controllers\CustomizeViewAgainstRoleMainWindowController that tracks View showing using theXafApplication.ViewCreating event and replaces the default View's Id with a custom Id found in the Application Model by the role name. 

Monday, September 12, 2016

Why can a DetailView be not editable or display empty values?

This small thing may hit even experienced XAFers, so I want to post this tip here for the future. In fact, I created a corresponding KB article a few months ago, but forgot to promote it in my blog. So, here we go: https://www.devexpress.com/kb=T382896

SYMPTOMS
1. You are creating a new detail form via the XafApplication.CreateDetailView API in a Web application, but it does not allow users to enter any information; e.g., they can't write/select anything into/from lookups. The View controls also look "readonly" or disabled. The same code produces an editable DetailView in WinForms, though.
2. Same readonly View editors as in the previous point, but the controls do not display any values either + the code does not work in both WinForms and ASP.NET apps.
3. You are opening a DetailView of an object that was deleted by another user. This way, this behavior is normal and expected as removed data can no longer be edited.



SOLUTIONS
1. Make sure you have set the DetailView.ViewEditMode property to the DevExpress.ExpressApp.Editors.ViewEditMode.Edit value. For example, check the snippet from this KB Article:

Monday, September 5, 2016

About searching freelancers, programmers, consultants with the DevExpress expertise and XAF in particular


I have recently come back from a 3 week vacation on Crete and I feel in a good mood for blogging. BTW, in my first-time experience, this place has a plethora of sights for both active and cultural holidays, crystal clean sea, tasty traditional and sea food, fruits plus Greeks being very nice people all with a funny Tolis-like accent:-) - it will be the reason for my pleasant memories again and again.

Today, I want to cover a question which I periodically receive privately or in the Support Center:

"Can you recommend anyone that might be interested in working as a consultant/programmer to help us develop our XAF app?"


Well, there are surely many developers that can qualify for this, and the first and probably the best way of locating XAF freelancers (as well as freelancers for any other technology) is using specialized services like https://www.upwork.com and https://www.freelancer.com. I just picked the two ones from the top of my head, so there may be alternatives and you must learn more on them first. For instance, check these example queries:

Thursday, September 1, 2016

Minor usability improvement - Nullable values support for boolean property editors

In short, this feature was already supported by the underlying WinForms CheckEdit and ASP.NET ASPxCheckBox controls, but it required writing some custom code in XAF apps. Now this coding is no longer required for XAF users if they need a Nullable<bool> property.

Starting with v16.1.6, the two built-in XAF editors support boolean Nullable properties. In the UI, when the check box is used, nullable properties will be displayed using a third 'grayed' state. When a drop-down editor is used, an empty 'null text' item will be available. Technically, the PropertyEditor.AllowNull must return True for the aforementioned UI transformations to take effect.

Please see the following code examples and screenshots for more details:

        public bool? ThreeStateCheckBox {
            get;set;
        }
        [CaptionsForBoolValues("Checked", "Unchecked")]
        public bool? ThreeStateDropDown {
            get;set;
        }


Web

Windows


Simplifying the migration from SecuritySystemUser to the new PermissionPolicyUser API

We have recently prepared a KB article on the subject: How to use the new Allow/Deny permissions policy in the existing project and hope to hear your feedback on it and this new Allow/Deny security feature in particular. If you have not yet heard about it and its possible benefits for your project, I recommend you review the Concepts > Security System > New Security System > Permission Policies documentation along with a short overview video on our YouTube channel.



As a side note, a quite popular How to hide individual navigation items and groups for certain users example was updated to use the new PermissionPolicyRole class.

As always, our team is more than happy to learn more on how our security module can help your business better or assist in case of any difficulties. Feel free to contact us via the Support Center: https://www.devexpress.com/Support/Center/Question/Create  or in comments here.

UPDATED:
See also this post from our old customer http://www.codeproject.com/Articles/1153095/How-to-migrate-DevExpress-XAF-SecuritySystemUser-t  for an alternative migration procedure.

Wednesday, August 3, 2016

What is New in Help in XAF v16.1

As you probably know, in addition to the new great features the version 16.1 introduced, there are also various improvements to the learning materials that will allow you get the most of DevExpress products and become a better developer. The XAF documentation changes we are the most interested in are listed below. I highlighted the topics I personally like or value the most in yellow. 




The good news is that there are even more documentation updates currently in the works, and hopefully, I will be able to announce them to you soon. To give you a hint, improved window resizing mechanism for both Windows and the Web, improved concepts for showing Views, registering property editors are among the things you will be able to learn more about in the future.


Concepts and task-based help

Usability improvements to the Model Editor layout designer and more in XAF v16.1.5

The recently released minor update brings several small, but useful features I hope you and your end-users will appreciate.

1. The layout designer available in the Model Editor at design time and runtime now generates a layout very close to what you can see in the end app. In particular, being invoked for the WinForms modules or apps, it now generates real Property Editors (in the disabled state and with fake data) instead of equivalent text boxes or bricks. It also tries to take into account and visualize the most popular layout and other options like ToolTip, ShowCaption, etc. IMHO, the most useful thing here is that you can now customize embedded ListView elements or List Property Editors corresponding to collection properties much easier via the grid control, like you can already do under the Views | ListView | Columns node. Even though the layout designer invoked for Web modules will not display real Web controls, but rather their corresponding WinForms analogs, the overall development experience will be better than before.