Alternatives for enum= attribute in options-enumeration
-------------------------------------------------------
Key: STS-298
URL: http://mc4j.org/jira/browse/STS-298
Project: Stripes
Issue Type: Improvement
Components: Tag Library
Affects Versions: Release 1.4.1
Reporter: Andy
Assigned To: Tim Fennell
Priority: Minor
Currently the stripes:options-enumeration tag requires the enum= attribute to
specify the full class name of the enum.
<stripes:form action="/MyAB.action">
<stripes:select name="myProperty">
<stripes:options-enumeration enum="xxx.enums.MyEnum"/>
</stripes:select>
</stripes:form>
Assuming that MyAB.getMyProperty() is declared to return xxx.enums.MyEnum, a
better way to specify the enum class is to specify the property name
("myProperty" in this case). The actual enum class is then looked up in the
action bean that is specified in the enclosing stripes:form.
<stripes:form action="/MyAB.action">
<stripes:select name="myProperty">
<stripes:options-enumeration for="myProperty"/>
</stripes:select>
</stripes:form>
An even better way is to omit the for= and enum= attributes altogether, because
the property name is already specified in the enclosing stripes:select tag.
<stripes:form action="/MyAB.action">
<stripes:select name="myProperty">
<stripes:options-enumeration/>
</stripes:select>
</stripes:form>
However the for= attribute may be useful in the rare cases where the name
property in stripes:select refers to a different property.
With this enhancement, the enum= attribute becomes non-mandatory, the for=
attribute is added, and it is an error to specify both.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://mc4j.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development