Ticket S39397
Visible to All Users

Core - Redesign ListViewAutoCommitController and WinDetailViewController to customize them properly

created 13 years ago

Although the AutoCommitListView property is public, it is controlled from within the controller and it is not intuitive to customize it:
 See the following tickets for details:
Problem with Focus in ListView when AutoCommit = true,
Error 1007 with ListViewAutoCommitController when clicking an Action that gets disabled during the commit operation,
Save action disabled because of "Is Modified" - caused by ListViewAutoCommitController.
This controller can be also refactored to avoid a problem described in the UI.Win - TreeList focus is restored incorrectly after canceling changes in ListViewAndDetailView mode ticket.

Comments (2)

    Will this be implemented in 12.2?

    Dennis Garavsky (DevExpress) 12 years ago

      No, we have not yet planned this suggestion for any particular release.

      Answers approved by DevExpress Support

      created 12 years ago (modified 12 years ago)

      We have implemented the functionality described in this ticket. It will be included in our next update(s).

      Please check back and leave a comment to this response to let us know whether or not this solution addresses your concerns.

      Additional information:

      We have introduced the new ModificationsController controller with two platform-specific descendants (WinModificationsController and WebModificationsController). These controllers are activated for both Detail and List Views and replace the obsolete DetailViewController, WinDetailViewController, WebDetailViewController, and ListViewAutoCommitController. The new ModificationsController.ModificationsHandlingMode property, which specifies the application behavior when a user modifies data and then changes the current object or closes the View, should be used instead of the AutoCommitListView and SuppressConfirmation properties. The ModificationsHandlingMode possible values are:
      Confirmation – the “Do you want to save changes” confirmation is displayed;
      AutoCommit - data modifications are committed automatically;
      AutoRollback - data modifications are discarded.
      To specify the ModificationsHandlingMode in your code, inherit WinModificationsController and/or WebModificationsController and override the OnActivated method.

      C#
      class MyWinModificationsController : WinModificationsController { protected override void OnActivated() { base.OnActivated(); if ((View is ListView) & (TargetObjectType == typeof(Task))) this.ModificationsHandlingMode = DevExpress.ExpressApp.SystemModule.ModificationsHandlingMode.AutoCommit; } }

      Note that a custom value should be assigned after the base class’ OnActivated method is called, as the default value is calculated by this method. Avoid changing the ModificationsHandlingMode by accessing the ModificationsController from a custom controller via the Frame.GetController .method. Your custom controller may be activated before the ModificationsController activation, and your customization will be ignored.
      See also:

      Core - Support the capability to save all changes automatically (disable all confirmation requests)
      SystemModules - Make it possible to edit multiple records in an editable ListView at once and save the changes only when needed

        Comments (1)
        AM AM
        Andreas Mummenhoff 12 years ago

          Yes! This sounds perfect. Finally.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.