[Opensource] Expresso InputTag treats Readonly attribute as H idden (fix included)

Mike Traum mtraum at cirnetwork.org
Mon Mar 10 20:18:10 PST 2003


I did something similar for 5.01 that I haven't check in yet. But, instead
of using the ReadOnly attribute, I've added a 'disabled' property to the
Input class. Then, I've added the check for that flag to each Input type in
InputTag.

I don't know which is better - my way seems to make more sense to me, but if
I recall correctly, ReadOnly is used by DBMaint?

mike

-----Original Message-----
From: Michael Rimov [mailto:rimovm at centercomp.com]
Sent: Monday, March 10, 2003 8:48 PM
To: opensource at jcorporate.com
Subject: Re: [Opensource] Expresso InputTag treats Readonly attribute as
Hidden (fix included)


At 11:58 AM 1/20/2003 -0800, you wrote:
>The Expresso 5.01/5.02 InputTag treats the Readonly attribute the same as 
>a Hidden attribute.
>Is this a bug or was there a reason for this?

Ken,

While going through emails for other bugs to fix for 5.0.4, I came across 
your post.  It is getting checked in and will be available for 
5.0.4.  Sorry that it got buried.  You proposed an excellant fix!

                                                 -Mike


>
>I've fixed the problem in InputTag.java as follows:
>
>- changed
>                 } else if 
> (Input.ATTRIBUTE_HIDDEN.equalsIgnoreCase(typeToUse) ||
> 
>Input.ATTRIBUTE_READONLY.equalsIgnoreCase(typeToUse)) {
>                     this.buildHiddenBox(writer);
>   to
>                 } else if 
> (Input.ATTRIBUTE_HIDDEN.equalsIgnoreCase(typeToUse)) {
>                     this.buildHiddenBox(writer);
>                 } else if 
> (Input.ATTRIBUTE_READONLY.equalsIgnoreCase(typeToUse)) {
>                     this.buildReadonlyBox(writer);
>- added
>     /**
>      * Build a readonly text field
>      *
>      * @param   writer the Jsp Writer
>      * @throws  Exception upon error
>      */
>     private void buildReadonlyBox(JspWriter writer)
>                          throws Exception {
>         if (writer == null) {
>             throw new Exception("JspWriter was null");
>         }
>
>         FastStringBuffer fsb = FastStringBuffer.getInstance();
>         try {
>             fsb.append("  <input type=\"text\" name=\"");
>             fsb.append(nameToUse);
>             fsb.append("\" size=\"");
>             fsb.append(sizeToUse);
>             fsb.append("\" maxlength=\"");
>             fsb.append(maxlengthToUse);
>             fsb.append("\" value=\"" );
>             fsb.append(valueToUse);
>             fsb.append("\" readonly>" );
>
>             writer.print(fsb.toString());
>         } finally {
>             fsb.release();
>         }
>     } /* buildReadonlyBox(JSPWriter) */
>
>Ken Chow
><mailto:ken_chow at shaw.ca>ken_chow at shaw.ca
>


_______________________________________________
Opensource mailing list
Opensource at jcorporate.com
http://mail.jcorporate.com/mailman/listinfo/opensource
Archives: http://mail.jcorporate.com/pipermail/opensource/



More information about the Opensource mailing list