stripes:label tag should check its body first when searching its value to
render.
---------------------------------------------------------------------------------
Key: STS-580
URL: http://www.stripesframework.org/jira/browse/STS-580
Project: Stripes
Issue Type: Improvement
Components: Tag Library
Affects Versions: Release 1.5
Environment: n/a
Reporter: Iwao AVE!
Priority: Minor
Currently, the stripes:label tag searches its value in the following order when
it is rendered.
- resource: {actionFQN}.{name}
- resource: {actionPath}.{name} (deprecated)
- resource: {name}
- The body of the label tag
- A warning message telling you to supply a label value somewhere!
I suggest that it should check the body first for efficiency and flexibility.
Consider the following form.
Billing Address:
<ss:label name="billingAddress.state" />: <ss:text
name="billingAddress.state" />
Shipping Address:
<ss:label name="shippingAddress.state" />: <ss:text
name="shippingAddress.state" />
Although both fields should have the same caption 'State' in the form, I would
like to display different name for each field in the validation error message.
e.g.
Billing Address: State is required.
Shipping Address: State is required.
If the body of the tag is searched first when it is rendered, I can write the
form as follows.
Billing Address:
<ss:label name="billingAddress.state">State</ss:label>: <ss:text
name="billingAddress.state" />
Shipping Address:
<ss:label name="shippingAddress.state">State</ss:label>: <ss:text
name="shippingAddress.state" />
And the StripesResources.properties will have entries like below.
billingAddress.state=Billing Address: State
shippingAddress.state=Shipping Address: State
# I assume that this change does not require anything special when the same
string can be used for caption and validation error message (i.e. backward
compatible).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://www.stripesframework.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development