How about returning the TextField itself from the subclass ? And the baseclass just returns a default TextField ?
On Wed, Jun 3, 2009 at 10:22 AM, tubin gen <fachh...@gmail.com> wrote: > I looking for some best practices or better way to control my page > components , like set enable add attribute modifiers etc. > > for example > > I have add and edit page , where one textField should be enabled in add > and disabled in edit so for this I did > > add(new > TextField<String>("findingNumber").setEnabled(enableFindingNumber())); > > protected boolean enableFindingNumber(){ > return false; > } > > > the subclass Add page will override this method to true .but this will not > be generic tomarrow If I need some attribute modifiers for addpage and > not for edit again I will do the same add a protected method call that in > textfield and override in addpage , this approach will make me change the > base class for everytime for any new features the sub class needs .I am > looking for some way through whcih I can retrieve the component in the sub > class and add decoratos without changing the base class ? > -- Regards, Vasu Srinivasan