LPS-42389

Hi Eudaldo,

LPS-42389 is a consequence of having the MDR actions inside the edit layout form. Any action (such as the described in the ticket) will get the current context and the data in the edit layout form lost. With my changes I've made those actions to be performed asynchronously, so that no functionality is lost and the form data is preserved.

I've applied the selectEntity pattern for the Select Device Family option. In order to hide the already chosen families, the selection dialog is configured with destroyOnHide. I had to change the code of this function in util.js to detach the selection handler also in the destroy event, as we do in the openDDMPortlet function.

@jbalsas suggested that this might not be the right way to do it. The visibleChange should be enough, but it doesn't work because of the order in which the methods are executed in aui_modal.js. One option could be to use "before" instead of "after" in the mentioned util.js functions. An even better approach could be to modify aui_modal.js line 181 and use A.soon(instance.destroy); I've cc'ed @eduardolundgren and @ipeychev so they know about this issue.

Thanks!