From e606dad4fece76958c2b190018d65fb79bf4d181 Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Tue, 6 Jul 2010 12:36:38 +0000
Subject: [PATCH] revert a part of r31835 and set 'cell' same as 'here' if
 'cell' is undefined, so that we can use the same formbox for both ListBox and
 non-ListBox using 'cell' parameter.

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

diff --git a/product/ERP5Form/FormBox.py b/product/ERP5Form/FormBox.py
index 1d41a21e43..1177159ee6 100644
--- a/product/ERP5Form/FormBox.py
+++ b/product/ERP5Form/FormBox.py
@@ -88,11 +88,12 @@ class FormBoxWidget(Widget.Widget):
     """
         Render a form in a field
     """
-    # If FormBox is inside ListBox, we want use REQUEST['cell'] as
-    # 'here'.
-    # XXX REQUEST['cell'] will remain after ListBox rendering. We need a
-    # way to check if it is inside ListBox or not correctly.
-    here = REQUEST.get('cell', REQUEST['here'])
+    here = REQUEST['here']
+    # If 'cell' is not defined, we define 'cell' just same as 'here', so
+    # that we can use the same formbox for both ListBox and non-ListBox
+    # using 'cell' parameter.
+    if not REQUEST.has_key('cell'):
+      REQUEST.set('cell', here)
     try:
       form = getattr(here, field.get_value('formbox_target_id'))
     except AttributeError:
-- 
2.30.9