FYI,
To fix this I've made the following modification to
org.chiba.adapter.web.HttpRequestHandler.java
If anyone has a better idea please let me know. Thanks
/**
* @param name
* @throws XFormsException
*/
protected void handleData(String name, String[] values)
throws XFormsException {
if (name.startsWith(getDataPrefix())) {
String id = name.substring(getDataPrefix().length());
// assemble new control value
String newValue;
if (values.length > 1) {
StringBuffer buffer = new StringBuffer(values[0]);
for (int i = 1; i < values.length; i++) {
buffer.append(" ").append(values[i]);
}
// added call to new method
newValue = trim( buffer.toString() );
} else {
// added call to new method
newValue = trim( values[0] );
}
this.chibaBean.updateControlValue(id, newValue);
}
}
// add new method
protected String trim( String value ) {
if( value != null && value.length() > 0 )
{
value = value.replaceAll( "\r\n", "\r" );
value = value.trim();
}
return value;
}
-----Original Message-----
From: William Boyd
Sent: Monday, January 17, 2005 10:50 AM
To: chiba-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
Subject: carriage returns in a textarea
Hello,
Has anyone else noticed this problem with Internet Explorer (IE) and the Chiba
Servlet engine?
If you enter this text into a textarea
"abc
123"
the chiba:data element will be set to
"abc
123"
When the textarea is rerendered, IE will render this as two carriage returns
instead of one. Mozilla renders one carriage return. In IE, every submit will
cause the carriage returns to double up. I think the solution is to set the
chiba:data element to "abc 123" instead of the above but I can't seem to
locate where this happens in Chiba.
Any ideas? I'll keep digging.
Thanks,
William Boyd
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
|