From 0d26ec8b991550b266b142d9c018052ede349698 Mon Sep 17 00:00:00 2001
From: Yoshinori Okuji <yo@nexedi.com>
Date: Wed, 10 Mar 2004 14:36:39 +0000
Subject: [PATCH] Revert a part of the previous change, to get back seb's
 change about current selection.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@581 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Form/ListBox.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/product/ERP5Form/ListBox.py b/product/ERP5Form/ListBox.py
index cdd3fe27cf..ab4a648f57 100755
--- a/product/ERP5Form/ListBox.py
+++ b/product/ERP5Form/ListBox.py
@@ -322,7 +322,7 @@ class ListBoxWidget(Widget.Widget):
         stat_method = field.get_value('stat_method')
         selection_index = REQUEST.get('selection_index')
         selection_name = field.get_value('selection_name')
-        #current_selection_name = REQUEST.get('selection_name','default')
+        current_selection_name = REQUEST.get('selection_name','default')
         list_action = here.absolute_url() + '/' + field.get_value('list_action')
 
         #LOG('Listbox',0,'search_columns1: %s' % str(search_columns))
@@ -672,7 +672,11 @@ class ListBoxWidget(Widget.Widget):
             method_path = getPath(here) + '/' + list_method.method_name
           except:
             method_path = getPath(here) + '/' + list_method.__name__
-          selection.edit( method_path= method_path, params = kw, list_url = url)
+          # Sometimes the seltion name is a list ??? Why ????
+          if type(current_selection_name) in (type(()),type([])):
+            current_selection_name = current_selection_name[0]
+          list_url =  url+'?selection_name='+current_selection_name+'&selection_index='+str(selection_index)
+          selection.edit( method_path= method_path, params = kw, list_url = list_url)
           #LOG("Selection kw", 0, str(selection.selection_params))
           here.portal_selections.setSelectionFor(selection_name, selection, REQUEST=REQUEST)
 
-- 
2.30.9