You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Troy Cauble <tr...@gmail.com> on 2010/09/09 18:06:03 UTC

localizer.getString() with null component ?

Should localizer.getString() work with a null Component?  Some of the
getString() forms say it's optional, but it didn't work for me until I passed
the component.


LONG VERSION:

I'm working with RadioChoices in a RefreshingView driven by a Map.
The standard choices localizations

  true=Yes!
  ....props.2.frag.value.true=Yes!

struck me as either too general or too positional, so
I thought I'd drive it by the Map keyword.

keyword.true=Oh, yeah!

So I put it in the renderer:

                public Object getDisplayValue(String object)
                {
                         // ...
                         return Application.get().getResourceSettings()
                                .getLocalizer().getString(key +
suffix, (Component)null, def);
                }


But it failed until I started passing the RadioChoice as the component value.
I would have guessed that the component was only needed for the long property
name, which I won't be using.

Insights?
Did I miss a better option than the renderer?

THANKS,
-troy

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org