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

Matthias Keller commented on WICKET-1851:
-----------------------------------------

The same but even more disturbing applies, if the
ThrowExceptionOnMissingResource setting is true
Then the exception from the first statement is propagated, leading to a 
'Unexpected RuntimeException' instead of that the second getString() is tried 
first.

There should probably be a further getString() method which doesn't adhere to 
the global settings to allow the second statement to execute at all.

> Default lookup keys don't work when UseDefaultOnMissingResource is false
> ------------------------------------------------------------------------
>
>                 Key: WICKET-1851
>                 URL: https://issues.apache.org/jira/browse/WICKET-1851
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.4
>            Reporter: Matthias Keller
>
> When in Application the following is set:
> getResourceSettings().setThrowExceptionOnMissingResource(false);
> getResourceSettings().setUseDefaultOnMissingResource(false);
> then a noisy but very visible message is displayed for every missing 
> resource. Unfortunately, calls to  getLocalizer().getString() then return 
> this warning message instead of the often used default "" for which it is 
> being checked afterwards. This leads to the effect that this warning message 
> is considered a valid value.
> Example:
> org.apache.wicket.markup.html.form.AbstractSingleSelectChoice -> 
> getDefaultChoice(final Object selected)
> There's this code:
> String option = getLocalizer().getString(getId() + ".null", this, "");
> if (Strings.isEmpty(option)) {
>       option = getLocalizer().getString("null", this, CHOOSE_ONE);
> }
> With the above settings, the 'null' property is NEVER found, as the first 
> call already returns the message "[Warning: String resource for 
> 'form.field.null' not found]", which is not empty.
> The expected behaviour though would be to also try to lookup the 'null' value.
> This seems to apply to other classes as well as I for example never got the 
> global  Required  property to work as each  form.field.Required  property 
> returns the error message....

-- 
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