From 70da9fc3939851e9f7f31a8ba5ebb0e5d42d63fc Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Tue, 16 Dec 2008 09:40:02 +0000
Subject: [PATCH] - allow to have more parameters for the tales expression of
 width and height,   usefull for listboxes

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

diff --git a/product/ERP5Form/FormulatorPatch.py b/product/ERP5Form/FormulatorPatch.py
index e6e08743ce..e5659d38d3 100644
--- a/product/ERP5Form/FormulatorPatch.py
+++ b/product/ERP5Form/FormulatorPatch.py
@@ -34,6 +34,7 @@ from ProxyField import ProxyField
 from MultiLinkField import MultiLinkFieldWidget
 from AccessControl import ClassSecurityInfo
 from DocumentTemplate.ustr import ustr
+from DocumentTemplate.DT_Util import html_quote
 from cgi import escape
 import types
 from zLOG import LOG
@@ -376,7 +377,17 @@ TextAreaWidget.render_view = TextWidget_patched_render_view
 
 original_TextAreaWidget_render = TextAreaWidget.render
 def TextAreaWidget_render(self, field, key, value, REQUEST, render_prefix=None):
-  return original_TextAreaWidget_render(self, field, key, value, REQUEST)
+  width = field.get_value('width', REQUEST=REQUEST)
+  height = field.get_value('height', REQUEST=REQUEST)
+
+  return render_element("textarea",
+                        name=key,
+                        css_class=field.get_value('css_class'),
+                        cols=width,
+                        rows=height,
+                        contents=html_quote(value),
+                        extra=field.get_value('extra'))
+
 TextAreaWidget.render = TextAreaWidget_render
 
 class IntegerWidget(TextWidget) :
-- 
2.30.9