[Opensource] Expresso InputTag treats Readonly attribute
as Hidden (fix included)
Michael Rimov
rimovm at centercomp.com
Mon Mar 10 18:47:40 PST 2003
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
>
More information about the Opensource
mailing list