I'm writing my own

It does this

    @Override
    public String loadStringResource(Component component, String key) {
        if (component == null) {
            return null;
        }
        String result = null;
        Locale locale = component.getLocale();
        String style = component.getStyle();

        IModel model = component.getInnermostModel();

        if (model != null) {
            Object object = model.getObject();

            if (object != null) {
                result = loadStringResource(object.getClass(), key, locale,
style);
            }
        }
        return result;
    }

Basically if does the translation lookup based on whatever object is set to
the model of the component.

It works fantastically except when the keys are in <wicket:message
key="foodbar"/> - because component becomes an instance of
MarkupInheritanceResolver$TransparentWebMarkupContainer and getModel returns
null.

Are there other circumstances where the component can be
MarkupInheritanceResolver$TransparentWebMarkupContainer and it not be a
page?


igor.vaynberg wrote:
> 
> sorry, but i dont really get what the problem is or why it matters
> what component stringresourceloader gets. it simply traverses up the
> hieararchy looking for .properties files
> 
> -igor
> 

-- 
View this message in context: 
http://www.nabble.com/loadStringResource%28Component-component%2C-String-key%29---correct-method-to-check-if-the-component-IS-a-Page--tp16930303p16974123.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to