[
https://issues.apache.org/jira/browse/WICKET-4238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Martin Grigorov resolved WICKET-4238.
-------------------------------------
Resolution: Not A Problem
This is already the case. The code looks like:
protected String getValue(final String variableName)
{
Object value = PropertyResolver.getValue(variableName, model);
if (value != null)
{
final IConverter converter =
getConverter(value.getClass());
if (converter != null)
{
return converter.convertToString(value,
Session.get().getLocale());
}
else
{
return value.toString();
}
}
return null;
}
I.e. if there is a registered converter then it is used, otherwise plain
.toString() is used.
> PropertyVariableInterpolator should use Converter and not toString()
> --------------------------------------------------------------------
>
> Key: WICKET-4238
> URL: https://issues.apache.org/jira/browse/WICKET-4238
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Reporter: Johannes Odland
> Priority: Minor
>
> StringResourceModel uses Localizer and PropertyVariableInterpolator to
> resolve variables in a property string.
> The property string could be "Hello ${name}" and the ${name} expression will
> be resolved against the model.
> The PropertyVariableInterpolator returns value.toString() for the model
> value.
> This works fine if the value is a string, but if it is a more complex object
> it does not work.
> It should use the converter that is registered for the given type in the
> application by calling
> Application.get().getConverterLocator().getConverter(type);
--
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