[
https://issues.apache.org/jira/browse/WICKET-4167?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13135164#comment-13135164
]
Andrea Del Bene commented on WICKET-4167:
-----------------------------------------
Thank you Peter for your advices. I agree with you, this is not properly an
issue or a bug, that's why I gave it a low priority. However IMHO sometimes
package properties are the best choice and I have to use a prefix for keys.
Think for example at a class called Product with an 'id_product_type' field
which qualifies product type. In this case is quite useful using a prefix and
reuse the bundle across application, for example in Label components, and is
quite intuitive having bundles like these:
product.id_product_type.0=Book
product.id_product_type.1=Electronics
product.id_product_type.2=Music
...
Anyway, as I said that's not a big deal or a serious problem, o we can keep
issue closed.
> WebMarkupContainer breaks message-lookup algorithm
> -----------------------------------------------------
>
> Key: WICKET-4167
> URL: https://issues.apache.org/jira/browse/WICKET-4167
> Project: Wicket
> Issue Type: Bug
> Affects Versions: 1.5.2
> Reporter: Andrea Del Bene
> Assignee: Peter Ertl
> Priority: Minor
> Attachments: QuickStart.zip
>
>
> I've got a little problem with message lookup. The case is the following:
> I've got a simple DropDownChoice (wicket id = testSelect) with some values,
> let's say "0" and "1". I want to localize these value in order to display
> "Sorry, it's bad" for zero and "Ok, its good!" for one. Since I want to reuse
> these bundle in other components and I don't want to insert them into
> Application.properties, the natural choice is to create a package.properties
> file inside common package of my application components. The bundles are the
> following:
> testSelect.0=Sorry, it's bad
> testSelect.1=Ok, its good!
> Ok, everything works fine for my testSelect and wicket supports this kind of
> customization. The problem arise when I decide to not add testSelect directly
> to my page but instead to add it to a WebMarkupContainer which groups other
> form components.
> Unfortunately now testSelect localization stops working. Since
> WebMarkupContainer is not inside my application components package, now
> PackageStringResourceLoader search the right key (ex: testSelect.0) in the
> wrong package (i.e. org.apache.wicket.markup.html).
> Is this a known issue? Can we modify PackageStringResourceLoader in order to
> extend key search across all loaded bundles (or at least across all parents
> bundles)? Any other idea?
> PS: an obvious workaround is to create a subclass of WebMarkupContainer in
> our custom package.
--
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