mbany at cincom.com
Fri Feb 11 12:42:51 CET 2005
This is to suggest a little refactoring (well, not so little).
This idea occured to me when I wanted to add a Form decoration
to a component, where one of the button should display a label
with embedded spaces like 'Send invoice'.
I think that it would make sense if method submitButtonOn:of:
in WAHtmlRenderer would send #labelForSelector: to the 'of'
parameter (anObject) rather than self.
This would provide the capability for decorated component to compute
the label for the button, allowing for spaces in the label for instance !
At the same time, #labelForSelector: should be moved up to
WAComponent (from WAFormDialog) to provide a default implementation
when adding a form decoration without subclassing WAFormDialog.
Actually this could be generalized to all the methods in WAHtmlRenderer
that are sending #labelForSelector: to self. It would provide more
flexibility for computing the labels if those messages were
sent to the 'of' parameter (anObject) rather than the renderer, giving
the responsibility to the 'of' parameter to compute its own label.
Finally, you may probably want to get rid of #labelForSelector: in
WAHtmlRenderer by sending #labelForSelector: to self rather than
to 'html' in a couple of places.
More information about the Seaside