What steps will reproduce the problem? 1. Create a wave 2. Add a gadget by clicking on the "jibsaw" icon and then ok the default gadget url. 3. Hit shift+enter to finish editing
What is the expected output? What do you see instead?
Gadget should remain in the blip, instead it disappears and a client shiny.
Please use labels and text to provide additional information.
Comment #1
Posted on Dec 1, 2010 by Helpful HippoYep, the same bug is occurring with the Caja doodads I'm preparing.
The problem is with the lifecycle of GWT widgets in the editor. There are a number of problems I thinks:
1) when an Editor is destroyed, it detaches any widgets for which it is still a logical parent.
This is the direct cause of the widgets being removed when editing is stopped. The Editor has two modes of operation now, 'ownsDocument' and '!ownsDocument'.
In Undercurrent, Editors run in !ownsDocument mode, because Undercurrent does not keep Editors around, it creates/destroys them when starting/stopping editing, and attaches/detaches them to/from documents as needed.
In Google Wave, Editors run in ownsDocument mode, where the client creates a unique long-lived Editor for every blip, and destroying the Editor destroys the document (i.e., while the document is alive, its Editor is kept alive).
The !ownsDocument mode is new for Undercurrent, so is not fully robust. This logic, of destroying widgets when the Editor is destroyed, is only legitimate in ownsDocument mode. In !ownsDocument mode, this should throw an Exception instead, because all widgets should have been orphaned or reparented off the Editor by the time it gets destroyed.
2) On stopping editing, GWT widgets from doodads are not being orphaned from the Editor (nor reparented to another Widget like the WavePanel).
In order for GWT widgets to be valid forms of rendering, they need a logical parent, and that parent must be something other than the Editor, because Editors only exist transiently. There is currently no code path for this, but ContentDOcument's rendering path needs to be given a GWT Panel to serve as the logical parent for any GWT widgets created by renderers, and that parent needs to be something like the Wave Panel. It may or may not make sense to reparent a ContentDocument's widgets to an Editor when it gets created; it doesn't seem necessary though.
I started investigating this with Dan thisafternoon. We have not reached a full solution yet.
Comment #2
Posted on Dec 1, 2010 by Helpful HippoUpdate: chatted with Dan, solution found, Dan will kindly take this on.
Comment #3
Posted on Dec 23, 2010 by Massive OxThis should be fixed by now.
Status: Fixed
Labels:
Type-Defect
Priority-Medium