Well if you have a Component you can use one of the getString methods.
It's just that the above also works if you do not have a component to work with.
Maurice
On Mon, Apr 21, 2008 at 10:27 PM, Edvin Syse <[EMAIL PROTECTED]> wrote:
> Maurice Marrink wrote:
>
> > String errorMessage
> > =Applicati
Maurice Marrink wrote:
String errorMessage
=Application.get().getResourceSettings().getLocalizer().getString(key,
someComponentOrNull,defaultMsg);
Is this the correct way of doing it? I think it would be really nice if
Session#error, info etc could take a resourceKey instead..
-- Edvin
Mau
String errorMessage
=Application.get().getResourceSettings().getLocalizer().getString(key,
someComponentOrNull,defaultMsg);
Maurice
On Mon, Apr 21, 2008 at 9:46 PM, Enrique Rodriguez <[EMAIL PROTECTED]> wrote:
> I'm curious what's up here, too, since Pro Wicket Listing 6-15 shows
> the use of St
I'm curious what's up here, too, since Pro Wicket Listing 6-15 shows
the use of StringResourceModel with Component#info. However, when I
tried that once, I simply got the Object#toString()-style output in my
FeedbackPanel!
Enrique
On Mon, Apr 21, 2008 at 12:40 PM, Edvin Syse <[EMAIL PROTECTED]>
Ryan Gravener wrote:
I think you can do error((String)(new ResourceModel("page.error").getObject()))
Nah.. besides beeing incredibly nasty, you just instantiate and unwrap it right
away. Can't see how that will help? :)
On Mon, Apr 21, 2008 at 3:11 PM, Edvin Syse <[EMAIL PROTECTED]> wrote:
I think you can do error((String)(new ResourceModel("page.error").getObject()))
On Mon, Apr 21, 2008 at 3:11 PM, Edvin Syse <[EMAIL PROTECTED]> wrote:
> Sometimes, I want to redirect to another page with an error message because
> of something I discover when the constructor runs. I would like to
Sometimes, I want to redirect to another page with an error message because of something I discover when the constructor runs. I would like
to do:
if(some_condition) {
Session.get().error("errmsg");
setResponsePage(PageClass.class);
return;
}
The problem is that Session#