GWT doesn't support what you are trying to do. You cannot add a widget to an arbitrary element that is already a descendant of a widget.
There are two alternatives that could work. You could create a Cell that switches to an editable via. See EditableTextCell for an example. Alternatively, you can position a PopupPanel with your editor widget directly over the cell. Thanks, John LaBanca [email protected] On Wed, Nov 3, 2010 at 10:11 AM, David Pinn <[email protected]> wrote: > When the user edits a node of my CellTree, I want to inject a > composite widget into the tree at that point to handle the editing. > > To experiment with this, I created the following custom TextArea sub- > class: > > class MyTextArea extends TextArea { > public static MyTextArea addToElement(Element parent) { > MyTextArea textArea = new MyTextArea(); > parent.appendChild(textArea.getElement()); > > textArea.onAttach(); > RootPanel.detachOnWindowClose(textArea); > > return textArea; > } > } > > When the user clicks on a node in the tree, I create an instance of > MyTextArea as follows: > > ta = MyTextArea.addToElement(parent); > > Tragically, I'm getting the following error message: "A widget that > has an existing parent widget may not be added to the detach list" > > I understand that when MyTextArea calls > parent.appendChild(textArea.getElement()), it attaches itself via a > chain of parent elements to the CellTree; and in doing so, it > disqualifies itself from registration in the 'detach list'. > > Soooo...can you see a way to do what I'm trying to do? > > -- > 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]<google-web-toolkit%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > > -- 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.
