[ 
http://www.stripesframework.org/jira/browse/STS-242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11151#action_11151
 ] 

Tim Fennell commented on STS-242:
---------------------------------

Levi: I don't think we want to do that, at least for now.  The goal here is to 
provide a much simpler way to do things for projects that don't need to 
localize - they can just keep everything in the bean.

If you really need control over the bundle properties that are used for field 
names I'd suggest that you log a separate JIRA for it and we'll try and get to 
it post-1.5.  Probably the right way to do that would be to move most/all of 
the code in LocalizationUtility into the LocalizationBundleFactory (and rename 
it?) so that you can plugin your own logic to translate bean+field to resource 
keys.

> Provide mapping for field to UI name in @Validate annotation
> ------------------------------------------------------------
>
>                 Key: STS-242
>                 URL: http://www.stripesframework.org/jira/browse/STS-242
>             Project: Stripes
>          Issue Type: Improvement
>          Components: Validation
>    Affects Versions: Release 1.3.2
>            Reporter: Howard Rafal
>            Assignee: Ben Gunter
>             Fix For: Release 1.5
>
>
> I have the following nested property validation:
>     @ValidateNestedProperties ({
>         @Validate(field="name", required=true),
>         @Validate(field="description", required=true),
>         @Validate(field="phenoDataType.dataTypeId", required=true),
>         @Validate(field="phenoUsageType", required=true)
>     })
>     private PhenoAttributeType selectedTrait;
> This results in:
>     Please fix the following errors:
>                 Selected Trait Description is a required field
>                 Selected Trait Name is a required field
>                 Selected Trait Pheno Data Type Data Type Id is a required 
> field
> I can map the fields in the resource file (thanks Tim), but that is limited 
> if two different pages call the same attribute two different things. Also, 
> the Validate annotation is where things are described, so it would be nice to 
> be able to give a replacement string or a localized string right there.
> I envision this looking like:
>     @ValidateNestedProperties ({
>         @Validate(field="name", required=true, alias="Name"),
>         @Validate(field="description", required=true, alias="Description"),
>         @Validate(field="phenoDataType.dataTypeId", required=true, 
> alias="Data Type"),
>         @Validate(field="phenoUsageType", required=true, alias="Used For")
>     })
>     private PhenoAttributeType selectedTrait;
> This would result in:
>     Please fix the following errors:
>                 Description is a required field
>                 Name is a required field
>                 Data Type Id is a required field
> This matches my labels on the page. Another alternative would be to match the 
> name to the label for this attribute on the page. The nice thing there is 
> that any changes to the label would automatically be propagated to the error 
> message without having to change the annotation.

-- 
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

        

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to