Using StringResourceModel with BreadCrumbPanel constructor

2011-02-16 Thread shetc

Hi All,

I am working a Wicket app that consists of one WebPage that displays a
number of different
BreadCrumbPanels. Each BreadCrumbPanel has a constructor where I call
StringResourceModel
to provide I18N strings for Labels, etc. This causes the well-known warning:

Tried to retrieve a localized string for a component that has not yet been
added to the page.

If I understand the BreadCrumbPanel usage, I instantiate BreadCrumbPanels as
a user
navigates through the app, which are activated within the host WebPage. The
warning is the
result of creating the BreadCrumbPanel instance prior to it being added to
the host WebPage.

What is the recommended approach to avoid the warning in this case?

Thanks,
Steve


-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Using-StringResourceModel-with-BreadCrumbPanel-constructor-tp3309130p3309130.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Using StringResourceModel with BreadCrumbPanel constructor

2011-02-16 Thread robert.mcguinness

My breadcrumb panels are usually tied to some model object which provides the
titles.  For titles that are read from a localized file I use:


@Override
public String getTitle() {
return
Application.get().getResourceSettings().getLocalizer().getString(some.key.here,
(Component)null, (String) null);
}

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Using-StringResourceModel-with-BreadCrumbPanel-constructor-tp3309130p3309252.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Using StringResourceModel with BreadCrumbPanel constructor

2011-02-16 Thread shetc

Thanks Robert. The issue is really for the other components that I am adding
to a BreadCrumbPanel such
as labels.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Using-StringResourceModel-with-BreadCrumbPanel-constructor-tp3309130p3309522.html
Sent from the Users forum mailing list archive at Nabble.com.

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