You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Tauren Mills <ta...@groovee.com> on 2007/08/17 03:22:52 UTC

Localizing title of ModalWindow

I'm using a panel based ModalWindow and want to localize the window
title.  Without localization, I'd do this:

modalWindow.setTitle("Edit User");

The setTitle() method takes a string, not a resource. I'm not clear
how to make this work.  I tried this:

modalWindow.setTitle((String)new ResourceModel("editTitle").getObject());

However, I then get this exception:

java.util.MissingResourceException: Unable to find resource: editTitle
     at org.apache.wicket.Localizer.getString(Localizer.java:233)
     at org.apache.wicket.Localizer.getString(Localizer.java:127)
     at org.apache.wicket.model.ResourceModel.getObject(ResourceModel.java:75)

I've tried adding the property "editTitle" to all sorts of property
files in my project, but it just isn't finding it.

What should I be doing?

Tauren

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


Re: Localizing title of ModalWindow

Posted by Matej Knopp <ma...@gmail.com>.
Sorry, that is just a typo. Will be fixed in a second.

-Matej

On 11/2/07, Per Newgro <pe...@gmx.ch> wrote:
> Is it correct that the jira entry says it is fixed in beta4? Because we use
> beta4 and the title still needs a Model instead of an IModel.
>
> Cheers
> Per
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Localizing title of ModalWindow

Posted by Per Newgro <pe...@gmx.ch>.
Is it correct that the jira entry says it is fixed in beta4? Because we use 
beta4 and the title still needs a Model instead of an IModel.

Cheers
Per

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


Re: Localizing title of ModalWindow

Posted by Tauren Mills <ta...@groovee.com>.
Thanks,

Added as https://issues.apache.org/jira/browse/WICKET-854

Tauren


On 8/16/07, Igor Vaynberg <ig...@gmail.com> wrote:
> setTitle(getString("editTitle"));
>
> but that method really should take an imodel, please add an rfe
>
> -igor
>
> On 8/16/07, Tauren Mills <ta...@groovee.com> wrote:
> >
> > I'm using a panel based ModalWindow and want to localize the window
> > title.  Without localization, I'd do this:
> >
> > modalWindow.setTitle("Edit User");
> >
> > The setTitle() method takes a string, not a resource. I'm not clear
> > how to make this work.  I tried this:
> >
> > modalWindow.setTitle((String)new ResourceModel("editTitle").getObject());
> >
> > However, I then get this exception:
> >
> > java.util.MissingResourceException: Unable to find resource: editTitle
> >      at org.apache.wicket.Localizer.getString(Localizer.java:233)
> >      at org.apache.wicket.Localizer.getString(Localizer.java:127)
> >      at org.apache.wicket.model.ResourceModel.getObject(ResourceModel.java
> > :75)
> >
> > I've tried adding the property "editTitle" to all sorts of property
> > files in my project, but it just isn't finding it.
> >
> > What should I be doing?
> >
> > Tauren
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>

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


Re: Localizing title of ModalWindow

Posted by Igor Vaynberg <ig...@gmail.com>.
setTitle(getString("editTitle"));

but that method really should take an imodel, please add an rfe

-igor

On 8/16/07, Tauren Mills <ta...@groovee.com> wrote:
>
> I'm using a panel based ModalWindow and want to localize the window
> title.  Without localization, I'd do this:
>
> modalWindow.setTitle("Edit User");
>
> The setTitle() method takes a string, not a resource. I'm not clear
> how to make this work.  I tried this:
>
> modalWindow.setTitle((String)new ResourceModel("editTitle").getObject());
>
> However, I then get this exception:
>
> java.util.MissingResourceException: Unable to find resource: editTitle
>      at org.apache.wicket.Localizer.getString(Localizer.java:233)
>      at org.apache.wicket.Localizer.getString(Localizer.java:127)
>      at org.apache.wicket.model.ResourceModel.getObject(ResourceModel.java
> :75)
>
> I've tried adding the property "editTitle" to all sorts of property
> files in my project, but it just isn't finding it.
>
> What should I be doing?
>
> Tauren
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>