Ticket T335163
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

The View.SelectedObjects property returns a collection of disposed objects in certain circumstances

FindObjectSpaceByObject method throws exception when a record is selected and Refresh Action is executed

created 9 years ago

Hello,

We are running into a serious problem with all our objects which implement the StateMachineProvider interface.
When such an object is selected in a list view and the Refresh button is clicked, the ObjectDisposedException is being raised.

Steps to reproduce:

  1. Start your ‘Feature Center’ demo (Web)
  2. Go to ‘State Machine’ -> ‘Payment Task’
  3. Select the task displayed in the list view
  4. Hit ‘Refresh’
  5. You should be presented with the Error page

The actual exception is being raised by the XPObjectSpace.FindObjectSpaceByObject().

Are there any suggestions that you could immediately give use on how to avoid this from happening as we are receiving multiple complaints from our users?

Thank you & Kind Regards,

Vincent

Comments (3)
DevExpress Support Team 9 years ago

    Hello Vincent,
    Thank you for the detailed description. I have managed to reproduce this behavior with our demo. I need additional time to research it. Please bear with me.
    In the meantime, I recommend you create your own SingleChoiceAction which will control the state represented by enum property.
    See How to populate single choice action's Items collection

    V V
    Vincent Micallef Decesare 9 years ago

      Hi Alexey,
      Thank you for your reply and suggestions.
      In the meantime, we have implemented the ‘IObjectSpaceLink’ interface in our classes and we are using the ‘ObjectSpace’ property of that interface instead of ‘FindObjectSpaceByObject’ method. This seems to be working fine.
      Are there any problems that you could foresee with this approach?
      Thank you & Kind Regards,

      DevExpress Support Team 9 years ago

        I have tested this approach and it works correctly. It should not cause any issue in this scenario because the ObjectSpace value is set before the GetStateMachines method execution.

        Answers approved by DevExpress Support

        created 9 years ago (modified 7 years ago)

        I have investigated this scenario and found that it is caused by incorrect behavior of the View.SelectedObjects property, see the The View.SelectedObjects property returns a collection of disposed objects in certain circumstances ticket for more details. We will see how to improve this situation, though I cannot promise any time frame. Thank you for your feedback. I greatly appreciate your cooperation.

        Anyway, would you please provide your end-user application so we can investigate how the IStateMachineProvider interface helps you in your work and whether or not there is a better solution for your task? See the attached project for more details. Don't hesitate to mark this ticket as private if necessary.

          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.