logo       

RE: carriage returns in a textarea: msg#00027

Subject: RE: carriage returns in a textarea
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&#13;
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&#13;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


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
boot-loaders.gr...    php.pear.genera...    debugging.valgr...    kde.redhat.user...    text.xml.xsl.ge...    culture.languag...    hardware.microc...    java.servicemix...    redhat.release....    web.zope.plone....    user-groups.lin...    opendarwin.webk...    video.mjpeg.use...    sysutils.bcfg2....    encryption.gpg....    lx-office.devel...    xfree86.forum/2...    mail.mutt.devel...    acpi.devel/2003...    qnx.openqnx.dev...    network.irc.irs...    freebsd.devel.m...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe