I actually have a follow up question regarding StringResourceModel - the
tutorial shows this example, which makes sense:
add(new Label("greetings", new StringResourceModel("label.greetings",
this, new Model(user))));
Now, if I want to call a method that returns a String instead, like
so...
add(new Label("greetings", new StringResourceModel("label.allAlbums",
this, new Model(getTotalAlbums())));
^^^^^^^^^^^
...with my properties file having this entry:
label.getTotalAlbums = All Albums: ${someReference}
Obviously, this doesn't work, since the new Model(xxx) call expects a
bean to be passed in. How can I do this with a simple method call? And
what would my someReference var be?
Hope this makes sense - I just want to avoid passing in/creating a bean.
Michael
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of James Carman
Sent: Monday, February 11, 2008 12:04 PM
To: [email protected]
Subject: Re: TabbedPanel tab names
Oops. That's what I meant. I had to use StringResourceModel in my
case because I had to supply parameters.
On 2/11/08, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> or just ResourceModel
>
> -igor
>
>
> On Feb 11, 2008 11:59 AM, James Carman <[EMAIL PROTECTED]>
wrote:
> > Have you tried StringResourceModel?
> >
> >
> > On 2/11/08, Michael Mehrle <[EMAIL PROTECTED]> wrote:
> > > Assuming the typical tabbed panel example below - is there a good
way to
> > > grab the tab name from the page's properties file? What I need to
do is
> > > to internationalize the tab name. I guess I could do my own call
to grab
> > > it from the classpath + the property file name. Was hoping
> > >
> > > List tabs = new ArrayList();
> > > tabs.add(new AbstractTab(new Model("first tab"))
> > > { ^^^^^^
> > > public Panel getPanel(String panelId)
> > > {
> > > return new TabPanel1(panelId);
> > > }
> > > });
> > >
> > >
---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]