Just look at the code, e.g. DataTextField. That's code duplication. It would be possible to wrap the textfield class/ use delegation but that would mean much more code, and also that class not being a 'TextField' because it would inherit from e.g. HTMLComponent directly.

All I want to do is stuff like:

class FValidateTextField extends TextField
{
public FValidateTextField(String name, Serializable object, String expression)
{
super(name, object, expression);
add(new FValidateAttribModifier(this));
}
}


There's nothing wrong with wanting to do that, is there? I mean, by adding such a modifier to instances I really introduce new behaviour which thus satisfies the inheritance requirement of behaviour, but it is still a text field that uses the normal text field rendering behaviour.

Eelco


Martijn Dashorst wrote:

And this is not possible using delegation? Or would that be too much effort on the developers part?

Martijn


Eelco Hillenius wrote:

When working on the contrib section, it's quite irritating that most form component implementations (like TextField etc) are final. What I would like to do a lot (and think other users might as well) is just override such a class and provide a custom constructor that adds eg some attribute modifiers or validators. I also think this would be quite a common use case for users that want to implement their componany std's components etc.

I would like to propose to make the form components non-final *but* finalize all important methods that have component specific implementations (like handleComponentTag or handleBody) final.

Any objects/ what's your vote?

Eelco


------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop




------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop




-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to