With that code you are adding an attribute modifier ever time the button
renders
And you did get an exception i guess because you call getString() out of the
blue inside a construtor of a not fully constructed class.
To do that you have to lazy get the string through a model.getObject().
Then also a language change will result that the button will be translated
on the fly
johan
On 10/26/07, nico <[EMAIL PROTECTED]> wrote:
>
> Thanks, that worked for me,
> however i needed to add the modifier in onBeforeRender, within the
> constructor an exception
> was thrown
> @Override
> public void onBeforeRender() {
>
> submitButton.add(
> new SimpleAttributeModifier("value",
> getString("buttontxt.send")));
> super.onBeforeRender();
> }
>
> > Not at a computer, but have you tried:
> >
> > button.add(new SimpleAttributeModifier("value", getString("your.key"));
> >
> > Or
> >
> > button.add(new SimpleAttributeModifier("value", new ResourceModel("
> your.key"));
> >
> > It may not be called ResourceModel - the name is escaping me right now.
> >
> > Jeremy Thomerson
> > -- sent from a wireless device
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>