StringResourceModel does not use defaultValue properly
------------------------------------------------------

                 Key: WICKET-528
                 URL: https://issues.apache.org/jira/browse/WICKET-528
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.2.6
            Reporter: Ryan Crumley
            Priority: Minor
         Attachments: stringresourcemodel.patch

The construction in StringResourceModel that takes an argument 'defaultValue' 
does not pass it to Localizer.getString (called from 
StringResourceModel.getString()) so the default value never has the opportunity 
to be used.

In addition Localizer.getString(...) did not substitute property expressions if 
the specified key was not found and defaultValue was used instead. 
@see
        public String getString(final String key, final Component component, 
final IModel model,
                        final Locale locale, final String style, final String 
defaultValue)
                        throws MissingResourceException

This was a problem for me because I wanted my default value to be provided by 
the model (instead of being resolved statically at construction time) so I 
passed the string "${modelValue}" as my default value.

The provided patch fixes both these issues in 1.2.6.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to