I wanted to add a Label with ClickHandler to the title of a
DialogBox.
There is no direct support for adding widgets to the titlebar, but
there is support for HTML.
I tried out a little trick - before going on a queste to replace yet
another widget in GWT:
I use this as a content for the title:
"<div style='float:right' id='helpid'>Help</div> The title"
in the onload of my customized dialog I wrap the helpid div into a
Label widget and then attach a ClickHandler.
This seems to work fine except in DevMode where I get an assertion
error:
java.lang.AssertionError: A widget that has an existing parent widget
may not be added to the detach list
at
com.google.gwt.user.client.ui.RootPanel.detachOnWindowClose(RootPanel.java:
136)
at com.google.gwt.user.client.ui.Label.wrap(Label.java:79)
at com.acme.gwt.widget.client.ActionDialog.onLoad(ActionDialog.java:
166)
at com.google.gwt.user.client.ui.Widget.onAttach(Widget.java:294)
at com.google.gwt.user.client.ui.Widget.setParent(Widget.java:417)
at com.google.gwt.user.client.ui.Panel.adopt(Panel.java:119)
at com.google.gwt.user.client.ui.ComplexPanel.add(ComplexPanel.java:
93)
at com.google.gwt.user.client.ui.AbsolutePanel.add(AbsolutePanel.java:
75)
at com.google.gwt.user.client.ui.PopupPanel
$ResizeAnimation.onInstantaneousRun(PopupPanel.java:311)
at com.google.gwt.user.client.ui.PopupPanel
$ResizeAnimation.setState(PopupPanel.java:208)
at com.google.gwt.user.client.ui.PopupPanel.setState(PopupPanel.java:
1374)
at com.google.gwt.user.client.ui.PopupPanel.show(PopupPanel.java:969)
at com.google.gwt.user.client.ui.DialogBox.show(DialogBox.java:347)
at com.acme.gwt.widget.client.ActionDialog.show(ActionDialog.java:
226)
at com.google.gwt.user.client.ui.PopupPanel.center(PopupPanel.java:
488)
Am I not allowed to use this wrap method in such scenario ? Is there
an alternative to the restricted DialogBox ? Or is this a bug in the
wrap method for which I should file an incident report ?
David
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.