Commit 4314c249 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

update an specified selection only in firstPage() and lastPage(), because...

update an specified selection only in firstPage() and lastPage(), because modifying REQUEST will affect all listbox in the page. this will fix the failure in testPagerInViewMode of erp5_ui_test.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28536 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6896dbae
......@@ -657,7 +657,11 @@ class SelectionTool( BaseTool, UniqueObject, SimpleItem ):
lastPage.
"""
if uids is None: uids = []
REQUEST.form['list_start'] = 0
selection = self.getSelectionFor(list_selection_name, REQUEST)
if selection is not None:
params = selection.getParams()
params['list_start'] = 0
selection.edit(params=params)
self.uncheckAll(list_selection_name, listbox_uid)
return self.checkAll(list_selection_name, uids, REQUEST=REQUEST)
......@@ -682,7 +686,8 @@ class SelectionTool( BaseTool, UniqueObject, SimpleItem ):
if total_lines != BIG_INT:
lines_per_page = params.get('list_lines', 1)
last_page_start = int(total_lines) - (int(total_lines) % int(lines_per_page))
REQUEST.form['list_start'] = last_page_start
params['list_start'] = last_page_start
selection.edit(params=params)
self.uncheckAll(list_selection_name, listbox_uid)
return self.checkAll(list_selection_name, uids, REQUEST=REQUEST)
......
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