Ticket Q390724
Visible to All Users

Error 1007 with ListViewAutoCommitController when clicking an Action that gets disabled during the commit operation

created 13 years ago

Hi,
we have a problem using your ListViewAutoCommitController.
The commit behaviour is generally fine, but we ran into some issues in conjunction with using actions.
In detail, we have an action that is registered on ObjectSpace.ModifiedChanged event. This action gets enabled or disabled
depending on ObjectSpace.IsModified value.
Editing a cell value and clicking the action would trigger the commit, but raises also the error 1007: cannot execute inactive or disabled action.
Afterwards the action is drawn as disabled, which is correct.
It seems that the standard save action also shows this behaviour in this scenario.
Can you help us to prevent this error? The behaviour is ok but it would be nice to allow clicking and ignoring this error somehow.
Attached is a sample project that represents this scenario.
To reproduce the error, you need the following steps:

  1. Open the Country_ListView with navigation menu entry 'Country'. The view should be in ListAndDetail mode.
  2. Create a Country and a child Bank object and save.
  3. Edit the 'Bank' object directly in the nested ListView of 'Country' and click the action 'Some Action' (located in nested ListView menu bar).
    Alternatively you could try the save action, which should trigger the same error.
    Feel free to ask if you need further explanation.
    Greetings, Kim Schmidt
Show previous comments (7)

    Hi,
    the save action is needed, because you can edit in the detailView and for the detailView autocommit should be inactive. The AutoCommit is only active if you are editing in the nestedListView.
    Maybe I got to add that the first View in which we need this feature is a MasterDetail View. We got a listView on the left side… and the corresponding editView (DetailView). This DetailView has a lot of nestedListViews… in these views the user will add thousands of objects. It's important to save after editing and so we need the autoCommit feature only in these nestedListViews. That's the concept our product managers and customers want.
    Thank you
    Kim

    DevExpress Support Team 13 years ago

      Hi Kim,
      Thank you for the additional information. We are working on your issue and will answer you as soon as possible. We are sorry for the delay.
      Thanks,
      Michael.

      DevExpress Support Team 13 years ago

        Hi Kim,
        >>>the save action is needed, because you can edit in the detailView and for the detailView auto-commit should be inactive. The AutoCommit is only active if you are editing in the nestedListView.
        Remember that both detail and list views exist in the same object space. So, changes of the entire object tree are committed even if you call the CommitChanges method from any nested list view. Why not to trigger auto-commit for detail views too and deactivate the Save action?
        We will not suppress the exception in order not to introduce a breaking change. This exception notifies the developer about a problem in his/her controller logic.
        If you still want to show the Save button when auto-commit is enabled, deactivate the built-in Save action and create a custom Save action that does not depend on the ObjectSpace.Modified property value and is always active.
        Thanks,
        Michael.

        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.