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

Ben Gunter commented on STS-625:
--------------------------------

The field names don't match because you used fieldMap[field1] in your JSP, and 
Stripes comes up with the field name from the @Validate(field="field1") by 
appending a dot and then the field name to the field name to which the nested 
@Validate applies. In this case, fieldMap.field1. I don't know if you'll have 
any luck using nested validation against a map key, but you should at least 
change your property name in the JSP to fieldMap.field1 instead of 
fieldMap[field1].

> auto focus on error - map fields
> --------------------------------
>
>                 Key: STS-625
>                 URL: http://www.stripesframework.org/jira/browse/STS-625
>             Project: Stripes
>          Issue Type: Bug
>          Components: Tag Library
>    Affects Versions: Release 1.5
>            Reporter: Ram
>            Priority: Minor
>
> Auto focus on error does not work for map fields.
> For example,
> <stripes:text name="fieldMap[field1]"/>
> And in the ActionBean,
> @ValidateNestedProperties( {
>        @Validate(field="field1", required=true)
> })
> private Map<String, String> fieldMap;
> Validation works as expected. But the auto focus doesn't work and i see the 
> following in the logs.
> SEVERE: Form with action [/test/Test.action] has 'focus' set to '', but did 
> not find a field with matching name to set focus on.
> Stepping through the code in the IDE showed that the 
> "setFocusOnFieldIfRequired" method in FormTag class doesn't find the field 
> because the field name in the Validation error is "fieldMap.field1" ( vs 
> "fieldMap[field1]" in the Form/JSP ).
> Shouldn't the original field name be preserved ?

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

        

------------------------------------------------------------------------------
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to