On Nov 29, 2007 7:17 PM, loren <[EMAIL PROTECTED]> wrote:
> What am I missing?
I think the problem is you set the enabled/disabled model value once,
statically, in the constructor, so it forever maintains the value
correct at that time.
The simplest way to work around this is to set the model object every
time from the buttons @Override onSubmit() method.
Now a nicer (but more advanced) way would be to keep your strings for
the button captions in (localised) property files in the form of
toggle.true=Disable
toggle.false=Disable
and then the buttons model can be something like this:
IModel action = new StringResourceModel("toggle.${account.enabled}",
this, new Model(user));
Not 100% sure, I'm just making it up :-)
Gabor Szokoli
>
>
> //Set the model for the enable/disable account button also known
> as "toggle"
> Model action = new Model();
> if(user.getAccount().getEnabled()){
> action.setObject("Disable");
> }else action.setObject("Enable");
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]