# HG changeset patch
# User Arthur Lutz <arthur.lutz@logilab.fr>
# Date 1234283202 -3600
# Node ID e1e100276f596a4ae50754d34c71eb02bf993f34
# Parent  f37ee42cd0e98a54fa4e0cb6c87269f6542b157d
add page_size argument

diff -r f37ee42cd0e9 -r e1e100276f59 web/component.py
--- a/web/component.py	Tue Feb 10 17:26:26 2009 +0100
+++ b/web/component.py	Tue Feb 10 17:26:42 2009 +0100
@@ -73,6 +73,17 @@
     selected_page_link_templ = u'<span class="selectedSlice"><a href="%s" title="%s">%s</a></span>'
     previous_page_link_templ = next_page_link_templ = page_link_templ
     no_previous_page_link = no_next_page_link = u''
+
+    @classmethod
+    def selected(cls, req, rset, row=None, col=None, page_size=None, **kwargs):
+        """by default web app objects are usually instantiated on
+        selection according to a request, a result set, and optional
+        row and col
+        """
+        instance = super(NavigationComponent, cls).selected(req, rset, row, col, **kwargs)
+        if page_size is not None:
+            instance.page_size = page_size
+        return instance
     
     def __init__(self, req, rset):
         super(NavigationComponent, self).__init__(req, rset)