--- a/src/pyams_portal/zmi/portlet.py Fri Jun 15 15:40:26 2018 +0200
+++ b/src/pyams_portal/zmi/portlet.py Mon Jun 18 17:11:37 2018 +0200
@@ -26,6 +26,7 @@
from pyams_form.form import ajax_config
from pyams_pagelet.pagelet import pagelet_config
from pyams_portal.zmi.widget import PortletRendererFieldWidget
+from pyams_skin.event import get_json_widget_refresh_event
from pyams_template.template import template_config
from pyams_utils.adapter import adapter_config
from pyams_utils.url import absolute_url
@@ -108,6 +109,24 @@
weight = 10
+ def get_ajax_output(self, changes):
+
+ def get_form_factory(context, request):
+ return PortletSettingsPropertiesEditor(context, request, self.parent_form)
+
+ output = super(PortletSettingsPropertiesEditor, self).get_ajax_output(changes)
+ if 'renderer' in changes.get(IPortletSettings, ()):
+ renderer = self.context.get_renderer()
+ if (renderer is not None) and \
+ (renderer.target_interface is None) and \
+ (renderer.settings_interface is not None):
+ output.update({
+ 'close_form': False
+ })
+ output.setdefault('events', []).append(
+ get_json_widget_refresh_event(self.context, self.request, get_form_factory, 'renderer'))
+ return output
+
#
# Portlet renderer settings edit form