[tabs] don't spin madly when called in ajaxy/facet context; defer to default view
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Fri, 13 Mar 2009 11:05:37 +0100
changeset 1112 3cfc208e385b
parent 1106 de873146183a
child 1113 5608c79c789b
[tabs] don't spin madly when called in ajaxy/facet context; defer to default view
web/views/tabs.py
--- a/web/views/tabs.py	Thu Mar 12 15:18:54 2009 +0100
+++ b/web/views/tabs.py	Fri Mar 13 11:05:37 2009 +0100
@@ -101,8 +101,13 @@
                          'cubicweb.ajax.js', 'cubicweb.tabs.js', 'cubicweb.lazy.js'))
         # tabbed views do no support concatenation
         # hence we delegate to the default tab
-        if self.req.form.get('vid') == 'primary':
-            entity.view(default)
+        form = self.req.form
+        if form.get('vid') == 'primary':
+            entity.view(default, w=self.w)
+            return
+        rql = form.get('rql')
+        if rql:
+            self.req.execute(rql).get_entity(0,0).view(default, w=self.w)
             return
         # prune tabs : not all are to be shown
         tabs = self.prune_tabs(tabs)