[
https://issues.apache.org/jira/browse/WICKET-3929?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Pedro Santos updated WICKET-3929:
---------------------------------
Attachment: WICKET-3929.patch
Hi Carl, in the PropertyResolver javadoc the property[index] or property[key]
syntax is designed for properties. I'm attaching the test case working by
removing some '[' and ']' s
Anyway I'm 1+ for the patch because it makes the resolver syntax more
consistent by no differentiating the [index] in beginning of the expression
from those in the middle.
> PropertyModel/PropertyResolver breaks when using a List as the root object
> --------------------------------------------------------------------------
>
> Key: WICKET-3929
> URL: https://issues.apache.org/jira/browse/WICKET-3929
> Project: Wicket
> Issue Type: Bug
> Components: wicket-core
> Affects Versions: 1.4.17, 1.5-RC5.1
> Reporter: Carl-Eric Menzel
> Attachments:
> 1.4.x-0001-fix-problem-with-List-as-the-target-of-a-property-mo.patch,
> 1.5-0001-fix-problem-with-List-as-the-target-of-a-property-mo.patch,
> WICKET-3929.patch
>
>
> When using a java.util.List as the root target of a PropertyModel, and then
> using a property expression such as "[0].someProperty", PropertyResolver
> breaks rather badly, claiming that "0].somePropert" is not a valid property
> expression. Note the missing first and last characters.
> This happens because it first replaces all opening "[" with ".[", and thus we
> get a leading "." in the expression. That "." is then cut off, but the rest
> of the expression is suddenly treated as a single property name. A later step
> sees the leading "[" and thinks the whole thing is just a map/list index, and
> so drops the leading "[" and the last character (in the mistaken belief that
> the last character must be a "]".
> To make a long story short: The whole thing is fixed by eating the leading
> dots before entering the main resolver loop. I'm attaching patches for 1.4.x
> and trunk(1.5).
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira