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:
- Unpack attachments
- Open solution
- Compile and Run
- Execute action 'Show List View Im Memory'
- Double click to Edit object
- See exception
Actual Results:
Get exception with message
Value cannot be null.
Parameter name: obj
Expected Results:
DetailView open without exception
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:
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
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