[ 
https://issues.apache.org/jira/browse/WICKET-3753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13418194#comment-13418194
 ] 

Matthias Keller commented on WICKET-3753:
-----------------------------------------

Using converters to replace properties in KEYS should never happen as this 
leads to totally strange resource keys which cannot be handled anymore. For 
example:
new StringResourceModel("details.disabled.${disabled}", this.model) 
will result in keys like "details.disabled.yes" or "details.disabled.nein" 
since we're using a default boolean converter to display various booleans 
throughout the application.
The culprit is StringResourceModel.getResourceKey() which calls.  return 
PropertyVariableInterpolator.interpolate(resourceKey, model.getObject());  
which results in  PropertyVariableInterpolator.getValue() being called which 
does the conversion. Maybe there should be a flag on the interpolator whether 
or not to use converters?
                
> PropertyVariableInterpolator add support for IConverterLocator (patch 
> included)
> -------------------------------------------------------------------------------
>
>                 Key: WICKET-3753
>                 URL: https://issues.apache.org/jira/browse/WICKET-3753
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5-RC4
>            Reporter: manthos
>            Assignee: Igor Vaynberg
>             Fix For: 1.5-RC5
>
>         Attachments: converter.patch
>
>
> Add support for IConverterLocator to PropertyVariableInterpolator (see patch) 
> to work with known IConverter for properties.
> Sample code:
> getString("created", Model.of(item));
> properties:
> created=Item created at ${createDate} by ${user}.
> Currently createDate (and any other property) is always converted by 
> toString() instead of respecting IConverter to get properties localized.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to