SuggestBox and TextBox.wrap() combination

26 views
Skip to first unread message

igm

unread,
Oct 27, 2008, 5:34:11 PM10/27/08
to Google Web Toolkit
I find it very restrictive not to use TextBox.wrap(...) result in
combination with SuggestBox. When trying to use wrapped TextBox an
exception is thrown:

java.lang.IllegalStateException: Should only call onAttach when the
widget
is detached from the browser's document
at com.google.gwt.user.client.ui.Widget.onAttach(Widget.java:105)
at com.google.gwt.user.client.ui.Widget.setParent(Widget.java:231)
at com.google.gwt.user.client.ui.Composite.initWidget(Composite.java:
89)
at com.google.gwt.user.client.ui.SuggestBox.<init>(SuggestBox.java:
419)

I think that any TextBox should be possible to use in SuggestBox, also
those created by wrap(...) method.
Regarding SuggestBox I find it very restrictive it is "final". In
order to achieve desired effect, i.e. use SuggestBox with any TextBox
I had to copy&paste entire class (together with package visible
classes) and modify them.
Also I suggest not to extend Composite in SuggestBox. SuggestBox could
use any existing TextBox. So the user would not use SuggestBox as a
Widget, rather use TextBox and provide it to SuggestBox contructor so
that SuggestBox knows which TextBox to use to set value to.

I submited an issue (http://code.google.com/p/google-web-toolkit/
issues/detail?id=3040) regarding this topic.
Reply all
Reply to author
Forward
0 new messages