Bug Report B134959
Visible to All Users

Exception when open DetailView from ListView for persistent object stored in ObjectSpaceInMemory

created 16 years ago

I get exception when try open DetailView from ListView for persistent object stored in ObjectSpaceInMemory
When I create new object it doesn't store in ObjectSpaceInMemory
I guess problem with DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController
Steps to Reproduce:

  1. Unpack attachments
  2. Open solution
  3. Compile and Run
  4. Execute action 'Show List View Im Memory'
  5. Double click to Edit object
  6. See exception
    Actual Results:
    Get exception with message
    Value cannot be null.
    Parameter name: obj
    Expected Results:
    DetailView open without exception
Comments (2)
Dennis Garavsky (DevExpress) 16 years ago

    Hello Sergey,
    Thanks a lot for reporting this issue. We see the problem but it requires additional research from our side. Presently, to bypass the problem, override the GetObjectSpaceToShowViewFrom method of your application class as follows:

    C#
    public override ObjectSpace GetObjectSpaceToShowViewFrom(Frame sourceFrame) { if(sourceFrame != null && sourceFrame.View != null) { InMemoryDataStore dataStore = ((DevExpress.Xpo.Helpers.BaseDataLayer)(sourceFrame.View.ObjectSpace.Session.DataLayer)).ConnectionProvider as InMemoryDataStore; if(dataStore != null) { return ObjectSpaceInMemory.CreateNew( ((InMemoryDataStore)((DevExpress.Xpo.Helpers.BaseDataLayer)(sourceFrame.View.ObjectSpace.Session.DataLayer)).ConnectionProvider).Data); } } return base.GetObjectSpaceToShowViewFrom(sourceFrame); }

    We will get back to you ASAP.
    Thanks,
    Dennis

    Dennis Garavsky (DevExpress) 16 years ago

      Hello Sergey,
      We have to set the state of this bug to "Won't fix". To work properly with non-persistent objects, changes in the core of our framework are needed. Please track this suggestion in this regard: Core - Improve usability and support more scenarios of working with non-persistent objects.
      Currently, you can use the workaround shown above. It is for version 9.1.
      For the version 8.3 you will need to override the GetObjectSpaceToShowViewFrom method of a custom ShowViewStrategyBase descendant. To enable your custom view strategy, you have to override the CreateShowViewStrategy method of the XafApplication. Please see the MDIDemo for more information on how to use custom view strategies.
      Thanks,
      Dennis

      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.