Commit 8329e8a6 authored by Nicolas Delaby's avatar Nicolas Delaby

Allow to call nextPage and previousPage without REQUEST parameter

if REQUEST exists then redirection is performed. So listbox is rendered
uselessly.
parent c15cd672
...@@ -793,7 +793,8 @@ class SelectionTool( BaseTool, SimpleItem ): ...@@ -793,7 +793,8 @@ class SelectionTool( BaseTool, SimpleItem ):
return self.checkAll(list_selection_name, uids, REQUEST=REQUEST) return self.checkAll(list_selection_name, uids, REQUEST=REQUEST)
security.declareProtected(ERP5Permissions.View, 'nextPage') security.declareProtected(ERP5Permissions.View, 'nextPage')
def nextPage(self, list_selection_name, listbox_uid, uids=None, REQUEST=None): def nextPage(self, list_selection_name, listbox_uid, uids=None,
list_start=0, REQUEST=None):
""" """
Access the next page of a list Access the next page of a list
""" """
...@@ -802,6 +803,7 @@ class SelectionTool( BaseTool, SimpleItem ): ...@@ -802,6 +803,7 @@ class SelectionTool( BaseTool, SimpleItem ):
if selection is not None: if selection is not None:
params = selection.getParams() params = selection.getParams()
lines = int(params.get('list_lines', 0)) lines = int(params.get('list_lines', 0))
if REQUEST is not None:
form = REQUEST.form form = REQUEST.form
if form.has_key('page_start'): if form.has_key('page_start'):
try: try:
...@@ -816,7 +818,8 @@ class SelectionTool( BaseTool, SimpleItem ): ...@@ -816,7 +818,8 @@ class SelectionTool( BaseTool, SimpleItem ):
return self.checkAll(list_selection_name, uids, REQUEST=REQUEST) return self.checkAll(list_selection_name, uids, REQUEST=REQUEST)
security.declareProtected(ERP5Permissions.View, 'previousPage') security.declareProtected(ERP5Permissions.View, 'previousPage')
def previousPage(self, list_selection_name, listbox_uid, uids=None, REQUEST=None): def previousPage(self, list_selection_name, listbox_uid, uids=None,
list_start=0, REQUEST=None):
""" """
Access the previous page of a list Access the previous page of a list
""" """
...@@ -825,6 +828,7 @@ class SelectionTool( BaseTool, SimpleItem ): ...@@ -825,6 +828,7 @@ class SelectionTool( BaseTool, SimpleItem ):
if selection is not None: if selection is not None:
params = selection.getParams() params = selection.getParams()
lines = int(params.get('list_lines', 0)) lines = int(params.get('list_lines', 0))
if REQUEST is not None:
form = REQUEST.form form = REQUEST.form
if form.has_key('page_start'): if form.has_key('page_start'):
try: try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment