Without inheriting from the LinkUnlinkController it is vary difficult to modify behaviour for specific requirements. Unlike (say) the NewObjectViewController, the LinkAction or UnLinkAction Execute events cannot be properly intercepted to provide for alternative behaviour.
Proposed Solution:
Implement a similar event sequence to other controllers. For example:
controller.LinkExecuting(object, CancelEventArgs)
controller.LinkExecuted(object, LinkExecutedEventArgs)
controller.UnLinkExecuting(object, UnLinkExecutingEventArgs) (from CancelEventArgs)
controller.UnLinkExecuted(object, EventArgs)
We have closed this ticket because another page addresses its subject:
SystemModules.Link - Provide events to create and customize a custom Link ListView
Hello John,
Before introducing these events, we need to know exactly which custom functionality you would like to provide in the LinkUnLinkController.
For example, we already have a similar SystemModules.Link - Provide events to create and customize a custom Link ListView suggestion on our list, and we clearly know why it's required. Unfortunately, it's not clear from your proposal. Also, the Action itself already provides corresponding Executing and Executed events.
Why cannot they be used here?
Thanks,
Dennis
Hi Dennis
I tried subscribing to the LinkAction.Executing event but I think it must fire after the Popup window has appeared.
The idea is that you can harness the Link (or UnLink) action in a different way. In my case I wanted to do the following:
We have BOs Company and Contact with a many to many relationship (Company.Employees and Contact.Employers)
When a user adds a new contact to a Company (e.g. Link) we want to show a much more specialised search window based on a detailview for a non-persistent object which shows its results in an associated listview. On the ListView we have a New button so that if a user cannot find the right (say) Contact then they can create a new one. Basically much the same functionality as the standard Link button would give you but much more suitable for a) searching large databases (250,000 Contacts plus) and b) much more comprehensive searching capability which can include searching with aggregates and fuzzy name searches.
I did look at modifying the popup dialog and controller however changing it to use a detailview etc. seemed a bit over the top. Whereas if you had some suitable interception points for customising the way the controller works one could intercept things before the popup and do your own thing.
It is resolved at present by disabling the Link action and replacing it with a lookalike (Simple Action with the same image) however it did seem that the controller had little in the way of customisation - I am sure that the outcome of the suggestion you identified (sorry I missed it :-) ) will be fine.
Best wishes
John
P.S. The Many to Many association "features" of XAF/XPO continues to be exceeding challenging here in the real word, another story of course but this was the reason for raising the suggestion.
Hi John,
I have made it possible to accomplish your scenario with ease in 12.1. Find further details at SystemModules.Link - Provide events to create and customize a custom Link ListView an let me know whether this meets your needs or not.
Thanks,
Dennis