[tableview] don't fail with AttributeError when paginated as main content view stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 01 Jun 2010 13:19:43 +0200
branchstable
changeset 5619 a2c9a55b5a9d
parent 5618 24cc5d495fdf
child 5620 8bff6aae4623
[tableview] don't fail with AttributeError when paginated as main content view
web/views/tableview.py
--- a/web/views/tableview.py	Tue Jun 01 12:21:44 2010 +0200
+++ b/web/views/tableview.py	Tue Jun 01 13:19:43 2010 +0200
@@ -192,11 +192,14 @@
             self.w(u'</div>\n')
 
     def page_navigation_url(self, navcomp, path, params):
+        if hasattr(self, 'divid'):
+            divid = self.divid
+        else:
+            divid = params.get('divid', 'paginated-content'),
         rql = params.pop('rql', self.cw_rset.printable_rql())
         # latest 'true' used for 'swap' mode
         return 'javascript: replacePageChunk(%s, %s, %s, %s, true)' % (
-            dumps(self.divid), dumps(rql),
-            dumps(self.__regid__), dumps(params))
+            dumps(divid), dumps(rql), dumps(self.__regid__), dumps(params))
 
     def show_hide_actions(self, divid, currentlydisplayed=False):
         showhide = u';'.join(toggle_action('%s%s' % (divid, what))[11:]