ticket #636927, add ajaxhtmlhead in controller js_component stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 23 Mar 2010 18:35:04 +0100
branchstable
changeset 4976 34fd21f65702
parent 4975 35b0dd80dc06
child 4977 07be78d71d8e
ticket #636927, add ajaxhtmlhead in controller js_component
web/views/basecontrollers.py
--- a/web/views/basecontrollers.py	Tue Mar 23 18:16:35 2010 +0100
+++ b/web/views/basecontrollers.py	Tue Mar 23 18:35:04 2010 +0100
@@ -394,7 +394,14 @@
                              for key, value in extraargs.items())
         comp = self._cw.vreg[registry].select(compid, self._cw, rset=rset, **extraargs)
         extraargs = extraargs or {}
-        return comp.render(**extraargs)
+        stream = comp.set_stream()
+        comp.render(**extraargs)
+        extresources = self._cw.html_headers.getvalue(skiphead=True)
+        if extresources:
+            stream.write(u'<div class="ajaxHtmlHead">\n')
+            stream.write(extresources)
+            stream.write(u'</div>\n')
+        return stream.getvalue()
 
     @check_pageid
     @xhtmlize