Ticket S130847
Visible to All Users
Duplicate

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

Platform Independent way to determine Parent DetailView

Access DetailView from nested ListView (platform independent)

created 16 years ago

Hi guys
I agree with Casey's position in Q138613: There must be a clean, official and platform-independent way to access a parent DetailView from a nested ListView. - And I disagree with your position that such access would be improper:
Pure XPO allows (and even requires) access to parent objects in a collection scenario (e.g. one-to-many relationship with XPCollection). Why would you break this principle in XAF on the UI level? Why would it be any less proper to access the parent view than to access the parent object?
I currently have a scenario where I absolutely need this possibility: I have nested ListViews showing the class "Activity" which is linked to several other classes by many-to-many relationships. Now, when ever I create a new Activity within such a nested ListView, I need to find out the "context" (IOW the parent DetailView), so that I can set some default property values on the newly created object. Maybe I want to set the currently active Contact object… or the currently active Project object… etc.
Proposed Solution:
Your abstract base class "View" should contain two new properties:
public abstract View ParentView{ get; }
public abstract IEnumerable<View> ChildViews { get; }
Since your View class is already platform independent, I don't see any additional problems with this concept.

Show previous comments (5)
Dennis Garavsky (DevExpress) 16 years ago

    Hello Daniel,

    Thank you for the feedback. We already know how to implement this task but we also need to accept the decision on its importance and necessity. Usually our customers provide us with scenarios where they want to have information, not about the master detail view itself, but about its object.
    The scenario you described above is not an exception. I have already shown how to accomplish this using existing XAF functionality. So, before introducing some new functionality, we would like to know more about the scenarios, in which the problem can be solve with the new feature better than with existing functionality of XAF. For now, we have no reason to add this new functionality. If our customers provide us with such scenarios, we will revisit this suggestion.

    Thanks,
    Dennis

      Hi Dennis
      You're right. In the majority of cases it's sufficient to have access to the master object. I guess I wasn't aware of the correct way to get that information before. I now solved my problem using your official way stated at How to: Access the Master Object from the Nested List View
      Thanks for your excellent support and your great products!

      Dennis Garavsky (DevExpress) 16 years ago

        Hello Daniel,

        Thank you for the feedback. I am glad to know that you can manage your task successfully now. Regarding the suggestion on the ParentView property, we have no objections to implementing it, we just need a reason.
        So, I want to say generally to everyone interested in this ticket: just describe a helpful use case requiring accessing the whole master view, and we will be glad to review it, and probably implement the suggested feature.

        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.