Ticket S30563
Visible to All Users

Core - Improve usability and support more scenarios of working with non-persistent objects

created 16 years ago (modified 9 years ago)

- Automatically initialize CurrentObject in non-persistent detail views (Add/Instantiate NonPersistent Detail View in DashboardView). Provide the capability to show such a View from navigation without code.
- Support CRUD operations with non-persistent objects out of the box. It should be possible to make these operations using default XAF actions - CRUD operation for Non-persistent detailview in popupwindow. For this purpose, it should be possible to define a key property in a non-persistent class, and NonPersistentObjectSpace should be able to get values of these properties.
NonPersistentObjectSpace - Support showing persistent objects in non-persistent objects' views

Comments (1)

Answers approved by DevExpress Support

created 9 years ago (modified 9 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:

The New, Delete and Save Actions are now available for non-persistent objects. Modified objects are accessible using the NonPersistentObjectSpace.ModifiedObjects property. This property provides access to all created, deleted and modified objects within NonPersistentObjectSpace, unless the CommitChangesRefresh or Rollback  methods are called.

An example is provided in the How to: Perform CRUD Operations with Non-Persistent Objects  topic.

    Show previous comments (7)
    Anatol (DevExpress) 9 years ago

      You do not need to do anything specific to support this functionality - it is sufficient to declare a collection property like this:

      C#
      private BindingList<NonPersistentClass> _Collection; public BindingList<NonPersistentClass> Collection { get { if (_Collection == null) { _Collection = new BindingList<NonPersistentClass>(); } return _Collection; } }

        Hi Anatol

        Thanks for the response. A couple of questions on what you supplied.

        1. The generic type of BindingList would really be some other child class instead of NonPersistentClass, right?

        2. Assuming #1 is right, and the child class was NonPersistentChildClass, would this child class need to implement the IObjectLink interface if it was being aggregated by the NonPersistentClass parent ? Or could you just create and add instances of the NonPersistentChildClass in the initializer code present in the WindowController descendant and everything just work?

        Thanks

        Anatol (DevExpress) 9 years ago
          1. You can use any non-persistent class there.
          2. Built-in actions can work without the IObjectSpaceLink interface. This interface allows you to access an IObjectSpace instance inside your business objects. It does not affect how XAF processes these objects.

          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.