From 17f25fbfb9f9142c01a47d52a8cb75f96b91fa2f Mon Sep 17 00:00:00 2001
From: Vincent Pelletier <vincent@nexedi.com>
Date: Thu, 14 Sep 2006 23:10:36 +0000
Subject: [PATCH] Do not use hardcoded listbox name to store validation result
 into request. Add getPhysicalPath on renderer base class to make ZopeProfiler
 happy.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9941 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Form/ListBox.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/product/ERP5Form/ListBox.py b/product/ERP5Form/ListBox.py
index 15fe512827..c95e72dcbf 100644
--- a/product/ERP5Form/ListBox.py
+++ b/product/ERP5Form/ListBox.py
@@ -442,6 +442,14 @@ class ListBoxRenderer:
       if isinstance(v, VolatileCachingMethod):
         setattr(self, k, InstanceMethod(self, v))
 
+  def getPhysicalPath(self):
+    """
+      Return the path of form we render.
+      This function is required to be able to use ZopeProfiler product with 
+      listbox.
+    """
+    return self.field.getPhysicalPath()
+
   def getLineClass(self):
     """Return a class object for a line. This must be overridden.
     """
@@ -2800,7 +2808,7 @@ class ListBoxValidator(Validator.Validator):
         if len(listbox)>0:
           list_method = field.get_value('list_method')
           list_method = getattr(here, list_method.method_name)
-          REQUEST.set('listbox',listbox)
+          REQUEST.set(field.id, listbox)
           object_list = list_method(REQUEST=REQUEST,**params)
         for uid in listbox_uids:
           if str(uid).find('new') == 0:
-- 
2.30.9