You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Martin Tilma <m....@func.nl> on 2009/04/07 14:09:22 UTC

override isEnabed of FinishButton

Hello,

I have a Wizard with a FinishButton. I want the button always be 
enabled. Because the method isEnabled is final I cant override it.

I think coping the button and change the isEnabled method to always 
return true is a bit ugly. What is de best way to do it?

Regards,

Martin


-- 
Martin Tilma
Func. Internet Integration
W http://www.func.nl
T +31 20 4230000
F +31 20 4223500

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


Re: override isEnabed of FinishButton

Posted by Matthias Keller <ma...@ergon.ch>.
Hi Martin

I had a similiar problem a while ago - I solved it by copying that class 
- it was the fastest thing to do. However, feel free to post a bug 
report about removal of these final modifiers for the next version. They 
already removed some final's in the CLASS definition of these buttons 
for 1.3.5 on my request - I also think they just don't make any sense.

Matt

Martin Tilma wrote:
> Hi,
>
> Thnx for the reply, but your solutions won't fix my problem because 
> the isEnabled in FinishButton is implemented like this:
>
>     /**
>      * @see org.apache.wicket.Component#isEnabled()
>      */
>     public final boolean isEnabled()
>     {
>         IWizardStep activeStep = getWizardModel().getActiveStep();
>         return (activeStep != null && 
> getWizardModel().isLastStep(activeStep));
>     }
>
> Regards,
>
>
> Martin
>
> jcgarciam wrote:
>> I guess, you can try to override protected void onBeforeRender() and 
>> make
>> something like:
>>
>> protected void onBeforeRender(){
>>   this.setEnabled(true);
>>   super.onBeforeRender();
>> }
>>
>>
>>
>> Martin Tilma wrote:
>>> Hello,
>>>
>>> I have a Wizard with a FinishButton. I want the button always be 
>>> enabled. Because the method isEnabled is final I cant override it.
>>>
>>> I think coping the button and change the isEnabled method to always 
>>> return true is a bit ugly. What is de best way to do it?
>>>
>>> Regards,
>>>
>>> Martin


Re: override isEnabed of FinishButton

Posted by Martin Tilma <m....@func.nl>.
Hi,

Thnx for the reply, but your solutions won't fix my problem because the 
isEnabled in FinishButton is implemented like this:

	/**
	 * @see org.apache.wicket.Component#isEnabled()
	 */
	public final boolean isEnabled()
	{
		IWizardStep activeStep = getWizardModel().getActiveStep();
		return (activeStep != null && getWizardModel().isLastStep(activeStep));
	}

Regards,


Martin

jcgarciam wrote:
> I guess, you can try to override protected void onBeforeRender() and make
> something like:
> 
> protected void onBeforeRender(){
>   this.setEnabled(true);
>   super.onBeforeRender();
> }
> 
> 
> 
> Martin Tilma wrote:
>> Hello,
>>
>> I have a Wizard with a FinishButton. I want the button always be 
>> enabled. Because the method isEnabled is final I cant override it.
>>
>> I think coping the button and change the isEnabled method to always 
>> return true is a bit ugly. What is de best way to do it?
>>
>> Regards,
>>
>> Martin
>>
>>
>> -- 
>> Martin Tilma
>> Func. Internet Integration
>> W http://www.func.nl
>> T +31 20 4230000
>> F +31 20 4223500
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
> 


-- 
Martin Tilma
Func. Internet Integration
W http://www.func.nl
T +31 20 4230000
F +31 20 4223500

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


Re: override isEnabed of FinishButton

Posted by jcgarciam <jc...@gmail.com>.
I guess, you can try to override protected void onBeforeRender() and make
something like:

protected void onBeforeRender(){
  this.setEnabled(true);
  super.onBeforeRender();
}



Martin Tilma wrote:
> 
> Hello,
> 
> I have a Wizard with a FinishButton. I want the button always be 
> enabled. Because the method isEnabled is final I cant override it.
> 
> I think coping the button and change the isEnabled method to always 
> return true is a bit ugly. What is de best way to do it?
> 
> Regards,
> 
> Martin
> 
> 
> -- 
> Martin Tilma
> Func. Internet Integration
> W http://www.func.nl
> T +31 20 4230000
> F +31 20 4223500
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/override-isEnabed-of-FinishButton-tp22927709p22930094.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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