You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Guillaume Mary (JIRA)" <ji...@apache.org> on 2010/01/28 07:38:34 UTC

[jira] Created: (WICKET-2704) FormComponent.MessageSource.getMessage(String) and getValidatorKeyPrefix()

FormComponent.MessageSource.getMessage(String) and getValidatorKeyPrefix()
--------------------------------------------------------------------------

                 Key: WICKET-2704
                 URL: https://issues.apache.org/jira/browse/WICKET-2704
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.4.5, 1.4.4, 1.4.3
            Reporter: Guillaume Mary
            Priority: Minor


I tried to use the getValidatorKeyPrefix() feature to have a more suitable translation key for a RequiredTextField and the « required » message.
But Wicket wasn't able to find my key : the debug log said that it couldn't find my key whereas it is well-formed (getValidatorKeyPrefix() + ".Required").
So i debugged the getMessage(String) and I understood the problem. Arround the line 175 (in Wicket 1.4.5) we find :
// If not found try a more general form [prefix].[key]
if (Strings.isEmpty(message))
{
resource = prefix(prefix, key);
message = getString(localizer, key, formComponent);
}

The comment is good, but the code is wrong : the resource variable isn't used in the getString(...) ! (I think it's a kind of bad copy/paste from surrounding code)
We should find :
message = getString(localizer, resource, formComponent);

I did it and it works.

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


[jira] Resolved: (WICKET-2704) FormComponent.MessageSource.getMessage(String) and getValidatorKeyPrefix()

Posted by "Juergen Donnerstag (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2704?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Juergen Donnerstag resolved WICKET-2704.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.5-M1
                   1.4.7
         Assignee: Juergen Donnerstag

> FormComponent.MessageSource.getMessage(String) and getValidatorKeyPrefix()
> --------------------------------------------------------------------------
>
>                 Key: WICKET-2704
>                 URL: https://issues.apache.org/jira/browse/WICKET-2704
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.3, 1.4.4, 1.4.5
>            Reporter: Guillaume Mary
>            Assignee: Juergen Donnerstag
>            Priority: Minor
>             Fix For: 1.4.7, 1.5-M1
>
>
> I tried to use the getValidatorKeyPrefix() feature to have a more suitable translation key for a RequiredTextField and the « required » message.
> But Wicket wasn't able to find my key : the debug log said that it couldn't find my key whereas it is well-formed (getValidatorKeyPrefix() + ".Required").
> So i debugged the getMessage(String) and I understood the problem. Arround the line 175 (in Wicket 1.4.5) we find :
> // If not found try a more general form [prefix].[key]
> if (Strings.isEmpty(message))
> {
> resource = prefix(prefix, key);
> message = getString(localizer, key, formComponent);
> }
> The comment is good, but the code is wrong : the resource variable isn't used in the getString(...) ! (I think it's a kind of bad copy/paste from surrounding code)
> We should find :
> message = getString(localizer, resource, formComponent);
> I did it and it works.

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