Ticket Q242574
Visible to All Users

Inherit from an built-in Controller

created 15 years ago

Hi,
the XAF manual contains a section "Inherit From a Controller". I did this for the LinkUnlinkController in the common Module. I have overridden the CreateLinkView and UpdateActionsState todo some modifications. Now, if i start the Web Application i see there are 2 LinkUnlick controllers active. My inherited Controller, and the new? WebLinkUnlinkController.
So my question: How should we handle such scenarios. If i derive from an buildin common controller, probably in the next version you add an platform specific controller and then i have 2 of the same controllers active… So whats the recommended way?
thx

Show previous comments (9)
Dennis Garavsky (DevExpress) 15 years ago

    Hello Noxe,
    >>
     I will research this problem further, and most likely will create a new suggestion in this regard. For now, I remember customers complaining about the Delete action in the Role_Users_ListView. I admit that there may be other scenarios.
    Even though it's easy to write a couple lines of code to remove the Delete Action, we could consider the possibility of changing the default behavior.
    I will get back to you with my results as soon as I can.
    <<
    As I promised, I have finished my research and found that we need to seriously consider changing the default behavior with the Delete and New Actions (as well as with the corresponding AllowNew, AllowDelete flags) and provide more flexibility to control the Link/Unlink actions.
    I have created a new product feature (Nested ListView Usability Improvements) that for now, consists of the following references to the suggestions, questions and forum threads:
    SystemModules.Link - the AllowNew and AllowDelete attributes for nested ListView should not impact the Link and Unlink actions
    SystemModules.Delete - Usability of ListView that represents Many-To-Many collection
    SystemModules.Link - Exclude objects that are already linked to an object from the Link ListView
    SystemModules.Link - Provide events to create and customize a custom Link ListView
    SystemModules.Delete - Provide the capability to deny the Delete operation for some collection property
    Persistent.BaseImpl - Remove the Delete action from the nested Role ListView of the root User DetailView
    Inherit from an built-in Controller
    The LinkDetailViewController should not add objects in case of many-to-many association.
    How to remove Delete button when LinkUnlink are active
    hiding an action an listview
    Briefly, what people mostly want is the following:

    1. Support the New Action in the nested ListView for a Many-To-Many collection;
    2. Remove/Disable the Delete Action when the Unlink Action is shown, because these two actions are often messed up;
    3. Provide independent control (the new AllowLink, AllowUnlink flags) for the Link, Unlink Actions and remove the current dependency on the AllowNew, AllowDelete flags;
    4. Filter the Link popup ListView from records that are already linked, to avoid choosing duplicate records and to improve the end-user experience.
      Feel free to add your vote to these suggestions to show us that this is important to you. Thanks for the help.
      Thanks,
      Dennis
    M M
    Martin Praxmarer - DevExpress MVP 15 years ago

      Hi Dennis,
      we drifted away from my original issue. How should i implement now my functionality for Win/Web? Since there is now an LinkUnlinkController and an WebLinkUnlinkController, how can i implement my platform independend code?

      Dennis Garavsky (DevExpress) 15 years ago

        Hello Noxe,
        >>
        we drifted away from my original issue. How should i implement now my functionality for Win/Web? Since there is now an LinkUnlinkController and an WebLinkUnlinkController, how can i implement my platform independend code?
        <<
        Sorry for the inconvenience, I thought that I have already answered your question above:
        >>>>public class LinkUnlinkController : DevExpress.ExpressApp.SystemModule.LinkUnlinkController
        >>As I've already said the only solution here is to inherit from the WebLinkUnlinkController.
        >>>>Also if there are platform specific controllers, i cannot place code in an common place.
        >>Sure and I am afraid this is how XAF is currently designed.
        >>I have created two suggestion to improve the code of the LinkUnlinkController in future versions:
        >>SystemModules.Link - Provide events to create and customize a custom Link ListView
        >>SystemModules.Link - Exclude objects that are already linked to an object from the Link ListView
        To reiterate, it's now impossible to implement a platform-independent code to accomplish your task without changing the sources and rebuilding our libraries or without creating descendants of the controllers for each platform and duplicating the code. I have created corresponding suggestions to improve the LinkUnlinkController to make it possible to accomplish your task by handling an event. Is this clear now?
        Should you have any additional questions, let me know. I will be glad to help you.
        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.