Thought this conversation should be made public...

Emily mentioned in her review comment for r1180 that the
DateBox.getTextBox() JavaDoc
needs a warning about calling setText() directly on the TextBox. Aren't
there going
to be many other potentially dangerous things one could do with that TextBox
reference? Adding to another container or calling removeFromParent() seem
ripe for
abuse. Also, getTextBox().getParent() effectively exposes the entire DOM
innards of
the Composite, doesn't it? Composite.getWidget() is protected for a reason,
I would
think.


I think the getTextBox() change was buried in an event-based thread.  The
question was to add methods like
addTextBoxClickHandler/addTextBoxChangeHandler/addTextBoxFocusHandler  or to
have a public getTextBox() method that the user could then add handlers to.

The current decision was that since a user could already pass a text box
into a suggest box, there were enough benefits to using the simpler coding
model. However, it is inherently less safe as it allows users to do stupid
things. It also, as we see here, establishes a precedent that may or may not
be the one we want to establish.


So, for  SuggestBox, and, by implication, DateBox and any other *Box widget
we create, do we want to delegate to all the text box methods we support or
do we want a getTextBox method?







-- 
"There are only 10 types of people in the world: Those who understand
binary, and those who don't"

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to