--- "Craig R. McClanahan" <[EMAIL PROTECTED]> wrote:
>
>
> On Thu, 22 Mar 2001, David Winterfeldt wrote:
>
> > The disabled attribute sounds best if enought
> browsers
> > support it, but if they don't what if readonly
> wasn't
> > an html attribute, but a Struts one and if it was
> > 'true' the field could written out as text? I
> don't
> > know know if this has already been suggested or
> not.
> >
>
> Two Issues:
>
> (1) Render as text only
>
> This idea is appealing for text or textarea type
> fields, if we are willing
> to accept the difference in visual appearance. But
> how would you render
> disabled checkbox, radio button, or combo box
> controls? Or would it be
> acceptable to only use disabled on text and
> textarea?
>
I had to do something like this for a report and if
there was a standard gif or jpg to represent a
checked/unchecked checkbox and selected/unselected
radio button I think it would be ok. Or use text
(which wouldn't look nice), but have it somewhere in
the configuration to specify an image for a checked
checkbox. Also, if someone had a combo box, they
would have supplied a collection or list of keys and
values so the display value could be generated.
Hidden fields for anything written out as text or
images could be created at the same. It would just
encapsulate this.
<logic:equal name="registrationForm" property="action"
scope="request" value="Create">
<html:text property="username" size="16"
maxlength="16"/>
</logic:equal>
<logic:equal name="registrationForm" property="action"
scope="request" value="Edit">
<bean:write name="registrationForm"
property="username"
scope="request" filter="true"/>
<html:hidden property="username"/>
</logic:equal>
instead
<logic:equal name="registrationForm" property="action"
scope="request" value="Create">
<html:text property="username" size="16"
maxlength="16"/>
</logic:equal>
<logic:equal name="registrationForm" property="action"
scope="request" value="Edit">
<html:text property="username" size="16"
maxlength="16" readonly="true"/>
</logic:equal>
The output would be the same. And in the future when
all browsers support the disabled feature that could
be used instead.
> (2) Standard compliance
>
> So far, 100% of the HTML code that Struts tags
> generates is compliant with
> the HTML 4.01 specification. This will become more
> important if and when
> XHTML becomes more popular, because you can then
> validate conformance. To
> me, this is an important principle. What do you
> think?
>
I think it is important to comply to the standards as
much as possible.
> > David
>
> Craig
>
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/