You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by chitraa <ac...@gmail.com> on 2008/09/25 04:35:42 UTC

Cannot over the isDisabled() method for the DirectLink component

Hi all,

I extended the DirectLink component and am currently trying to override the
its isDisabled() method. However, when the component gets rendered, the
DefaultLinkRenderer class's renderLink() method does not call this overriden
isDisabled() method. Instead, I think it is referencing a default disabled
variable.

Has anyone experienced this bug before? Can this possibly be a bug in the
Tapestry code or is there a workaround to it?

Thank you.
CC
-- 
View this message in context: http://www.nabble.com/Cannot-over-the-isDisabled%28%29-method-for-the-DirectLink-component-tp19662090p19662090.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Cannot override the isDisabled() method for the DirectLink component

Posted by chitraa <ac...@gmail.com>.
Yea, thats in T4. I am not sure if I understand why disabled is marked as a
parameter for all link components? It seems to work fine for other form
components like Submit.

I tried to not define 'disable' as a parameter but to no luck :(

Hence, as a workaround:
1. I extended the ILinkComponent and created another abstract method. This
is so that the DefaultLinkRenderer class's renderLink() method can call the
new abstract method when it checks whether the DirectLink component fed into
it is disabled.
2. I also made my custom DirectLink component implement my extended
ILinkComponent class. This ensures that my custom DirectLink class has the
implementation of the abstract method i created in my custom ILinkComponent
class.

Its a little messy but it works. So, is this a bug in T4 that should be
reported?
-- 
View this message in context: http://www.nabble.com/Cannot-override-the-isDisabled%28%29-method-for-the-DirectLink-component-tp19662090p19680997.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Cannot over the isDisabled() method for the DirectLink component

Posted by Andreas Andreou <an...@gmail.com>.
I guess that's in T4, right?

Because disabled is marked as a parameter for all those link
components, it can't
really be overriden - tapestry will always override it itself (adding code that
makes parameters work)

There are probably several ways to workaround this - try to NOT define
'disabled' as a parameter in your custom component.

On Thu, Sep 25, 2008 at 5:35 AM, chitraa <ac...@gmail.com> wrote:
>
> Hi all,
>
> I extended the DirectLink component and am currently trying to override the
> its isDisabled() method. However, when the component gets rendered, the
> DefaultLinkRenderer class's renderLink() method does not call this overriden
> isDisabled() method. Instead, I think it is referencing a default disabled
> variable.
>
> Has anyone experienced this bug before? Can this possibly be a bug in the
> Tapestry code or is there a workaround to it?
>
> Thank you.
> CC
> --
> View this message in context: http://www.nabble.com/Cannot-over-the-isDisabled%28%29-method-for-the-DirectLink-component-tp19662090p19662090.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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