Hi,
i create something of similar for a project. In my case i use java code in order to change the dialog.
I attach here an example.
If i can suggest you, after using this way i think that it's better to change the design of your components in order to avoid this kind of behaviour.
It's better that elements of a dialog that are related, are configured in the same dialog. If you need to make this configuration because you have a "container" and elements configured for this container, is better that you try to create just only one dialog or manage this configuration by using page property (if it's possible).
@Override
protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response)
throws ServletException, IOException {
BundleContext bundleContext = FrameworkUtil.getBundle(SessionService.class).getBundleContext();
ServiceReference<?> osgiRef = bundleContext.getServiceReference(SessionService.class.getName());
SessionService service = (SessionService) bundleContext.getService(osgiRef);
if (service != null) {
session = service.getSession();
String[] tabList = null;
String dialogPath = request.getParameter("dialogPath");
resourcePath = request.getParameter("resourcePath");
LOGGER.debug("dialogPath: "+dialogPath);
LOGGER.debug("resourcePath: "+resourcePath);
if (StringUtils.isNotBlank(dialogPath) && StringUtils.isNotBlank(resourcePath)) {
String tabPartialName = "image";
dialogPath += "/items/items";
Resource resource = request.getResourceResolver().getResource(resourcePath);
tabList = resource.getValueMap().get("nameoftabs", String[].class);
if (tabList != null && tabList.length > 0) {
WcmUtilsClassicUi.clearOldValueIntoResource(session, tabList, resource);
WcmUtilsClassicUi.clearOldDialog(session, dialogPath, tabPartialName);
updateDialogNodes(dialogPath, tabList, tabPartialName);
} else {
WcmUtilsClassicUi.clearOldDialog(session, dialogPath, tabPartialName);
}
}
} else {
LOGGER.error("Box - error on activate method: is null");
}
}