Hi guys,
We are developing a web application with a number of complex pages and
dozens of controls. These controls' readonly status should be set,
individually, at runtime. With the current (1.1) struts-html, out pages
should come out as a repetition of
<html:text property="someName" readonly='<%=
formBean.isReadonly("someName") %>'
styleClass='<%= formBean.isReadonly("someName")?
"ReadOnlyClass" : "ReadWriteClass" %>' />
With "someName" being replaced each time with the relevant property.
Since the application is big, but not huge, this is borderline
acceptable to us.
Now, of course, we could extend html:text -- and any other specific tag
we use -- to deal with it (or we could buy the tags from
http://struts.application-servers.com/), but I think the correct place
for the fix is BaseHandlerTag.java. What I have in mind is an additional
attribute to html:form that would define a generic mechanism for setting
the control properties, something along the lines of
<html:form ... readonlyIndicator="isReadonly" />
Which would then do the equivalent of planting the above code in all the
form controls.
Note: With CSS2, setting a specific style class for readonly controls
should not be necessary, because the selectors can handle it, and in
general, I understand that setting styles automagically goes close to UI
issues which struts-html may not want to deal with. However, setting the
readonly attribute is pure semantics, and even if you don't want to
include the styleClass feature, I would like you to consider this.
And of course, "disabled", although we don't specifically need it, would
be a natural candidate for the same treatment.
Do you think there's any chance of seeing something like this supported
in Struts?
Thanks,
Shai.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]