You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Carlos Pita (JIRA)" <ji...@apache.org> on 2007/08/16 07:51:31 UTC
[jira] Created: (WICKET-850) Bad message resolution when sibling
components require the same key
Bad message resolution when sibling components require the same key
-------------------------------------------------------------------
Key: WICKET-850
URL: https://issues.apache.org/jira/browse/WICKET-850
Project: Wicket
Issue Type: Bug
Components: wicket
Affects Versions: 1.3.0-beta2, 1.3.0-beta3
Reporter: Carlos Pita
Attachments: resources.tgz
Attached there is an example of two panels, each one with its own properties file that assigns a different message to the same key, that anyway are showing the very same message when added to a page as siblings at the top level.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (WICKET-850) Bad message resolution when sibling
components require the same key
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-850?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Igor Vaynberg resolved WICKET-850.
----------------------------------
Resolution: Won't Fix
Fix Version/s: 1.3.0-beta3
Assignee: Igor Vaynberg
the problem is that you call getstring() inside the constructor of the panel. at that time the panel hasnt yet been added to the page so wicket cannot retrieve the full hierarchy of the page.
so what would happen is:
panel1 calls getstring("message")
localizer creates a cache key which is usually key+component path. in this case because component hasnt been added to anything the cachekey is "message-"
wicket looks it up and stores it in cache.
now panel2 calls getstring("message")
because it also is not yet added to the parent the generated cache key is the same as in panel2: "message-" so localizer gets a cache hit and doesnt load the proper properties file.
i made several changes.
first i have added a warning to the log if getstring() is called on a component not yet added to the page.
second localizer will bypass cache for components not yet in the page. this will not always work, but will at least fix this current usecase and possibly others.
to fix this properly you should be doing add(new Label("message", new ResourceModel("message")); instead of add(new Label("mesage",getString("message"));
> Bad message resolution when sibling components require the same key
> -------------------------------------------------------------------
>
> Key: WICKET-850
> URL: https://issues.apache.org/jira/browse/WICKET-850
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.3.0-beta2, 1.3.0-beta3
> Reporter: Carlos Pita
> Assignee: Igor Vaynberg
> Fix For: 1.3.0-beta3
>
> Attachments: resources.tgz
>
>
> Attached there is an example of two panels, each one with its own properties file that assigns a different message to the same key, that anyway are showing the very same message when added to a page as siblings at the top level.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-850) Bad message resolution when sibling
components require the same key
Posted by "Carlos Pita (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-850?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carlos Pita updated WICKET-850:
-------------------------------
Attachment: resources.tgz
> Bad message resolution when sibling components require the same key
> -------------------------------------------------------------------
>
> Key: WICKET-850
> URL: https://issues.apache.org/jira/browse/WICKET-850
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.3.0-beta2, 1.3.0-beta3
> Reporter: Carlos Pita
> Attachments: resources.tgz
>
>
> Attached there is an example of two panels, each one with its own properties file that assigns a different message to the same key, that anyway are showing the very same message when added to a page as siblings at the top level.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-850) Bad message resolution when sibling
components require the same key
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-850?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12521245 ]
Igor Vaynberg commented on WICKET-850:
--------------------------------------
fixed
> Bad message resolution when sibling components require the same key
> -------------------------------------------------------------------
>
> Key: WICKET-850
> URL: https://issues.apache.org/jira/browse/WICKET-850
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.3.0-beta2, 1.3.0-beta3
> Reporter: Carlos Pita
> Assignee: Igor Vaynberg
> Fix For: 1.3.0-beta3
>
> Attachments: resources.tgz
>
>
> Attached there is an example of two panels, each one with its own properties file that assigns a different message to the same key, that anyway are showing the very same message when added to a page as siblings at the top level.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-850) Bad message resolution when sibling
components require the same key
Posted by "Chuck Deal (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-850?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12521065 ]
Chuck Deal commented on WICKET-850:
-----------------------------------
I am getting this warning message when the component ISA Page. In this case, it will never be added to a Page. Should I really be getting the warning message?
> Bad message resolution when sibling components require the same key
> -------------------------------------------------------------------
>
> Key: WICKET-850
> URL: https://issues.apache.org/jira/browse/WICKET-850
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.3.0-beta2, 1.3.0-beta3
> Reporter: Carlos Pita
> Assignee: Igor Vaynberg
> Fix For: 1.3.0-beta3
>
> Attachments: resources.tgz
>
>
> Attached there is an example of two panels, each one with its own properties file that assigns a different message to the same key, that anyway are showing the very same message when added to a page as siblings at the top level.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.