[Opensource] Expresso InputTag treats Readonly attribute as Hidden (fix included)
Thompson, Kris
kris.thompson at seurat.com
Tue Mar 11 06:42:39 PST 2003
I must say that I was way amazed to see the original code how it turned read-only into a hidden field!
I didn't even know about the disabled until this email and after playing around with it I would think that we would want both. For those who don't know the difference here it is
(Input boxes)
Disabled turns the value you may have assigned to the input box to be "grayed-out" and you cannot change the value
Whereas the Readonly input box does not gray the value out but you cannot change the value
(Radio buttons)
Disabled turns the button to be "grayed out" and you cannot check the button
Readonly does not do anything special, it even allows you to check the button!
In general it seems that I would prefer to use the disabled version over the read-only but there was a case, and that is how I noticed the issue with the read-only version, that I had to use read-only like it was meant to be used.
The code is already in 5.0.4 and HEAD for read-only so that part is fixed, next I or someone else can go in and add the disabled version.
Thanks Mike for point out the disabled!
Kris
> -----Original Message-----
> From: Mike Traum [mailto:mtraum at cirnetwork.org]
> Sent: Monday, March 10, 2003 9:18 PM
> To: 'opensource at jcorporate.com'
> Subject: RE: [Opensource] Expresso InputTag treats Readonly
> attribute as
> Hidden (fix included)
>
>
> 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/
> _______________________________________________
> 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