eXpress App Framework Team

November 2015 - Posts

  • XAF – A Simpler Way to Check Database Compatibility (Coming soon in v15.2)

     

    In earlier versions, to check the compatibility of an application and its database, a ModuleInfo table was created in the database. This table stores information on the module versions used in an application. When checking the compatibility of the database and the application, the versions stored in the ModuleInfo table are compared with actual module versions. A DatabaseVersionMismatch event occurs when there's a mismatch. By default, each module's version is set to "1.0.*" using the AssemblyVersion Attribute in the Properties\AssemblyInfo.cs file. The asterisk sign in the version indicates that the build and revision numbers in the version are autoincremented, and so version value is updated with each new build. As a result, WinForms and ASP.NET module versions may not be synced if you build WinForms and ASP.NET applications separately (e.g, when creating a ClickOnce installation or deploying to IIS).

      
    With v15.2, we've introduced a new application and database compatibility check mode; one that utilizes native XPO methodologies. In this mode, the following checks are performed:

    1. The database exists.

    2. All required tables exist.

    3. All required columns exist.

     

    The DatabaseVersionMismatch event occurs if any of these checks fails.


    The new XafApplication.CheckCompatibilityType property specifies which mode to use. The CheckCompatibilityType.ModuleInfo value indicates that the old mode that relies on the ModuleInfo table is used. This mode is still used by default for applications created with earlier versions of XAF. In applications created with the Solution Wizard in version v15.2, the XafApplication.CheckCompatibilityType value is CheckCompatibilityType.DatabaseSchema, which corresponds to the new mode detailed above. This property value can be changed in the Application Designer:


    Untitled (1)

     

    Note that the use of ModuleInfo is more complicated, but it ensures business logic compatibility in addition to data model compatibility. The new DatabaseSchema mode relies on the database schema only.

    A CheckCompatibilityType property has also been added to the IObjectSpaceProvider interface, allowing you to specify the mode individually for each Object Space Provider (when you use multiple databases). By default, it is set to null and the XafApplication.CheckCompatibilityType value is actually used. Another useful change with this interface is the new  IObjectSpaceProvider.SchemaUpdateMode property. You can now use it to specify handle compatibility checking for the database associated with the current Object Space Provider. The following values are available:

    • DatabaseAndSchema - Missing database is autocreated. The database schema is updated when the compatibility check fails.

    • None - Database compatibility issues are ignored.

    =======================================

    That's my  last post prior to launch and hopefully you've liked what we've done with XAF. As always, we want to hear your thoughts. Please tell us what you think of XAF v15.2.

  • XAF - Enhancements to Core and other modules (Coming soon in v15.2)

    Over the last few days, I've described some of the new features we've introduced into the eXpressApp Framework v15.2. In this post, I'll describe enhancements we've made to XAF's core and other modules.
    Reset View Settings
    The Reset View Settings Action re-opens the current View and resets all user customizations made to the View's model. This Action is disabled (grayed out) if there are unsaved changes.



    Detail Form Layout Customization in Code

    With this release, you can customize the Detail View's default layout in your Data Model code using the DetailViewLayout attribute. Please refer to the following example code/screenshot below:

    public class Contact {
        [Browsable(false)]
        public int ID { get; private set; }
        [DetailViewLayoutAttribute(LayoutColumnPosition.Left)]
        public string FirstName { get; set; }
        [DetailViewLayoutAttribute(LayoutColumnPosition.Right)]
        public string LastName { get; set; }
        [DetailViewLayoutAttribute("FullName", 0)]
        public string FullName {
            get { return FirstName + " " + LastName; }
        }
        [DetailViewLayoutAttribute(LayoutColumnPosition.Left)]
        public string Email { get; set; }
        [DetailViewLayoutAttribute(LayoutColumnPosition.Right)]
        public virtual Contact Manager { get; set; }
        [DetailViewLayoutAttribute(LayoutColumnPosition.Left)]
        public DateTime? Birthday { get; set; }
        [FieldSize(FieldSizeAttribute.Unlimited)]
        [DetailViewLayoutAttribute("NotesAndRemarks", LayoutGroupType.TabbedGroup, 100)]
        public string Notes { get; set; }
        [FieldSize(FieldSizeAttribute.Unlimited)]
        [DetailViewLayoutAttribute("NotesAndRemarks", LayoutGroupType.TabbedGroup, 100)]
        public string Remarks { get; set; }
    }



    Non-Persistent Objects Enhancements

    In this release we have extended support for usage scenarios when using non-persistent objects first introduced in v15.1:

    • The New, Delete and Save Actions are available for non-persistent objects. Modified objects are accessible using the NonPersistentObjectSpace.ModifiedObjects property.
    • The INotifyPropertyChanged.PropertyChanged event is now triggered for non-persistent objects.
    • The non-persistent Object Space is now accessible for objects that support IObjectSpaceLink.

    Security System Enhancements

    We continue making the new security system more capable with the following updates:

    • Security permissions are immediately refreshed once the administrator applies changes. You are no longer required to log off all affected users to refresh permissions (learn more...).
    • If the administrator grants certain permissions to a reference or collection property that participates in an association (one-to-many or many-to-many), the same permissions are automatically granted for a property at the other end of this association (learn more...).
    • The Data View mode in now supported.
    • Upcasting is now supported in List View columns.
    You should expect more news in this regard after the official release.



    General usability and API improvements:

    The following is a list of minor features that should make using XAF a little easier. While you can see the full list of these smaller enhancements in our What's New docs, I would like to highlight the following items:

    • S38140 - Core - Introduce IObjectSpace.Evaluate method that will evaluate a criteria expression against both EF and XPO objects (including Domain Components)
    • Q483608 - Core - Make it easier to obtain IQueryable<T> collection through IObjectSpace for LINQ
    • S171061 - Core - Provide an option to avoid saving a master record immediately when a new non-aggregated child object is created in a nested List View
    • S170756 - Core - Provide Refresh method overloads allowing the refresh of the underlying data source
    • T204296 - EF.Usability - Support complex types that are not registered in DbContext and have no key property
    • T177760 - EFDataView - Support common criteria function operators
    • S172038 - Core - Provide a simplified database compatibility check mode; one that relies on the database schema and ignores module assembly versions
    • T312781 - ImagePropertyEditor - Support images declared as reference properties instead of byte array
    • T303205 - Workflow - Add an option to repeat the workflow multiple times while the target object fits criteria

    =====================================

    I will post additional content on some of these items (like S172038) separatly, once we release v15.2. Please stay tuned and let us know what you think of these new features.

  • XAF - Web UX Enhancements (Coming soon in v15.2)

    In this release cycle, we've evolved our web page templates and themes optimized for touch devices (released in v15.1). While we still continue to refine things, we believe that this feature is ready to be used in production and we do not expect major breaking changes going forward.

    UPDATE: See also the XAF Goes Mobile: CTP Version Ships with v15.2.9 post to learn more on the related XAF 15.2 feature.

    In addition to numerous cosmetic enhancements and capabilities that were already test-driven in previous minor updates, let me highlight a few important features:

    1. Adaptive and Responsive Layout

    Our ASPxGridListEditor now supports adaptive layouts in the new web style. Columns are collapsed automatically when the browser window is resized.

    To enable this responsive mode, set the ASPxGridListEditor.IsAdaptive property in a ViewController. You can customize this behavior via the IModelColumnWeb.AdaptivePriority property in the Model Editor invoked for the ASP.NET project. 


    This option specifies the column's priority. Columns with a lower AdaptivePriority value remain visible when the browser window shrinks, while columns with a higher value are hidden. Hidden column data can be accessed via the ellipse "..." button. In the image above, both the SUBJECT and PROJECT columns have a lower AdaptivePriority value than others.

    2. Device-Specific Settings in ASP.NET Applications

    Web applications can now have separate settings for desktop, tablet and mobile devices. Device-specific model differences are stored in the Model.Desktop.xafml, Model.Tablet.xafml and Model.Mobile.xafml files. Database settings storage is also supported.

    3. Customizable ASP.NET Templates for Touch Devices

    Page templates designed for touch devices can be easily customized. Corresponding project item templates are now available in Visual Studio:

    • DevExpress v15.2 XAF ASP.NET Default Template Content V2
    • DevExpress v15.2 XAF ASP.NET Dialog Template Content V2
    • DevExpress v15.2 XAF ASP.NET Logon Template Content V2
    • DevExpress v15.2 XAF ASP.NET Nested Frame Control V2


    Reporting

    With v15.2, the DevExpress HTML5 Report Viewer is used by default. 


    Our Web Report Designer now supports parameters with complex types (including multi-value parameters for complex types).

    Finally, XAF's Reports Module can now store a layout in XML format, making complex report rendering much faster (learn more)!



    Confirm unsaved changes

    ASP.NET applications can now prevent loss of unsaved data by displaying a warning dialog if a user attempts to close the browser tab, or clicks an Action whose execution may lead to loss of unsaved data.


    This behavior is enabled by default. You can disable it using the ConfirmUnsavedChanges property of the Options node in the Model Editor invoked for an ASP.NET project:

    The option above is global. To enable/disable the confirmation dialog for a specific Action, use the ConfirmUnsavedChanges property of the ActionDesign | Action node.

    By default, the IModelActionWeb.ConfirmUnsavedChanges option is set to true for the following Actions: NextObject, PreviousObject, New, DialogCancel, DialogClose, ChooseTheme, Refresh, Cancel, Edit, Logoff, ChangeVariant

    Batch Edit support

    ASPxGridListEditor now supports Batch Edit Mode. Unlike other modes, Batch Edit allows you to edit multiple rows and then save all modified objects at the same time.


    To enable Batch Edit Mode, set the InlineEditMode property of the ListView node to Batch in the Model Editor and ensure that the AllowEdit property of the same node is set to true.


    Please note the following: 

        In Batch Edit mode, the Detail View is not invoked when a user clicks a row.
        A few data types cannot be edited: imagesreferencescriteriafile attachments.
        Initial property values for new objects are passed to the client when the grid control is created and are not updated each time you create objects using the New Command Item.

    Batch Edit Mode supports our new ConfirmUnsavedChanges and Validation module features.


    Master-Detail support

    ASPxGridListEditor now provides built-in support for the master-detail data presentation. To enable it, run the Model Editor for an ASP.NET project, and set the DetailRowMode property of the Views | ListView node to DetailView or DetailViewWithActions.


    In DetailViewWithActions mode, a Detail View specified using the DetailRowView property is shown in a detail row. In DetailView mode, the same Detail View is displayed, but the toolbar of its nested List View is hidden.


    By default, DetailRowMode is None and the master-detail mode is disabled.

    =====================================

    Please tell us what you think of these new features.

  • XAF - Web Map Module (Coming soon in v15.2)

    With this release, we're shipping a new Map module for XAF Web apps - allowing you display business objects on different kinds of maps. The module integrates the client-side dxMap and dxVectorMap widgets from DevExtreme into ASP.NET XAF applications via specialized XAF server-side wrappers like List and Property Editors: WebMapsListEditor, WebVectorMapsListEditor and WebMapsPropertyEditor.


    Primary Capabilities

    While designing this module, we considered customer feedback received during the research we conducted earlier this year and also previous user requests from the Support Center and other sources. Let's take a quick look at the functionality implemented in the initial release:


    1. Interactive map displays objects implementing the IMapsMarker interface using the Google Maps API or Bing Maps API:

    2015-09-30_1040.png

    2. Vector map displays objects implementing the IAreaInfo interface as areas with different colors:

    2015-09-30_1056.png


    3. Vector map displays objects implementing the IVectorMapsPieMarker interface as pie-chart markers:

    2015-09-30_1059.png

    You can experience a live demo of our Map module in the ListEditors | Maps section of the offline Feature Center demo that is installed with XAF or check its online version at demos.devexpress.com/xaf/featurecenter once v15.2 is officially released.


    Configuration

    You can configure map types via the Model Editor invoked from Visual Studio or in code:

    1. Configuring WebMapsPropertyEditor for a DetailView:

    2. Configuring WebVectorMapsListEditor for a ListView:

    3. Customizing the underlying dxMap widget in code of a ViewController for a ListView:

    using DevExpress.Persistent.Base;

    namespace DevExpress.ExpressApp.Maps.Web.Controllers {

       public class MapCenterController : ObjectViewController<ListView, Store> {

           protected override void OnViewControlsCreated() {

               base.OnViewControlsCreated();

               ((WebMapsListEditor)View.Editor).MapViewer.ClientSideEvents.Customize = GetCustomizeScript();

           }

           private string GetCustomizeScript() {

               return @"function(sender, map) {

           map.option('center', 'Brooklyn Bridge,New York,NY');

                          map.option('autoAdjust', false);

        }";

           }

       }

    }

    ===========================

    We'd love to get your feedback on this new Map module and whether you are planning to use it in upcoming XAF Web apps.

  • XAF - Validation Module Enhancements for Windows and the Web (Coming soon in v15.2)

    In our upcoming release of the eXpressApp Framework, data validation occurs immediately after input focus changes when validation rule evaluation does not require querying additional data from the server. These rules are RuleRequiredField,RuleRegularExpressionRuleStringComparisonRuleValueComparison and RuleRange.


    In-place validation is enabled for the Save context by default. To enable it for other contexts, use the AllowInplaceValidation property of the Validation | Contexts | Context node in the Model Editor.


    Since rule evaluation occurs on the client side, in-place validation does not occur when:


    The asterisk (*) symbol is automatically appended to an editor label when the RuleRequiredField is applied.

    In-place validation engine relies on Controllers provided in our platform-specific ValidationWindowsFormsModule and ValidationAspNetModule components.

    Note: The ASP.NET module was introduced in v15.2. In order to use in-place validation after upgrading your existing ASP.NET applications to v15.2, be certain to add  this module from the Toolbox into the Application Designer.

    =====================================

    The XAF Team would love your feedback. Please tell us what you think of these new features.

LIVE CHAT

Chat is one of the many ways you can contact members of the DevExpress Team.
We are available Monday-Friday between 7:30am and 4:30pm Pacific Time.

If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

FOLLOW US

DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, ASP.NET, WinForms, HTML5 or Windows 10, DevExpress tools help you build and deliver your best in the shortest time possible.

Copyright © 1998-2017 Developer Express Inc.
All trademarks or registered trademarks are property of their respective owners