Stripes

The field-metadata tag doesn't produce metadata for fields whose names include index notation ("[2]")

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: Release 1.5.1
  • Fix Version/s: Release 1.5.2, Release 1.6
  • Component/s: Tag Library
  • Labels:
    None
  • Environment:
    Linux (doubt it matters)

Description

For indexed bean properties, the metadata map is built such that the indexing notation (square brackets around a numeric index value) isn't there. That is, the DefaultValidationMetadataProvider stashes the metadata in the cache with a plain-looking property path.

When the field-metadata tag code goes about its business of providing metadata for all properties mentioned in a form, it doesn't strip out the indexing notation from form field names when looking for metadata. Because of the way the map is built, it doesn't find the metadata.

A workaround is to include a hidden disabled dummy field in the form whose name is an indexed property field name minus the index. This is made a little more difficult than it sounds because the <s:hidden> tag does not allow the "disabled" attribute to be provided.

This might not be "major", but it doesn't seem "minor" either. That's just me however.

Activity

Hide
Ben Gunter added a comment - 16/Oct/09 12:27 PM

Fixed for 1.5.2 (r1164) and 1.6 (r1165). Parameter names returned by FormTag.getRegisteredFields() are now stripped before use.

Show
Ben Gunter added a comment - 16/Oct/09 12:27 PM Fixed for 1.5.2 (r1164) and 1.6 (r1165). Parameter names returned by FormTag.getRegisteredFields() are now stripped before use.

People

Vote (0)
Watch (1)

Dates

  • Created:
    22/May/09 5:06 PM
    Updated:
    04/Jan/11 1:47 PM
    Resolved:
    16/Oct/09 12:27 PM