Index: trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorOutputWriter.java
===================================================================
--- trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorOutputWriter.java	(revision 1365)
+++ trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorOutputWriter.java	(revision 1429)
@@ -265,6 +265,6 @@
     /**
      * <p>
-     * dumps a GUI element starting with its parent GUI elements into the log file. Calls itself
-     * recursively to traverse for dumping the parents first.
+     * ensures that a GUI element, its parents as well as all other GUI elements on the same page
+     * are dumped
      * </p>
      *
@@ -274,12 +274,59 @@
         if (!loggedGUIElements.contains(guiElement)) {
             
-            HtmlGUIElement parent = guiElement.getParent();
-            String parentId = null;
-            
-            if (parent != null) {
-                ensureGuiElementDumped(parent);
-                parentId = parent.getId();
-            }
-            
+            // determine the document as the whole document needs to be dumped. Ensure also that
+            // the server is dumped
+            
+            HtmlGUIElement parent = guiElement;
+            HtmlDocument document = null;
+            HtmlServer server = null;
+            
+            while (parent != null) {
+                if (parent instanceof HtmlDocument) {
+                    document = (HtmlDocument) parent;
+                }
+                else if (parent instanceof HtmlServer) {
+                    server = (HtmlServer) parent;
+                }
+                
+                parent = parent.getParent();
+            }
+            
+            if (server != null) {
+                dumpGuiElement(server);
+            }
+            
+            if (document != null) {
+                dumpGuiStructure(document);
+            }
+        }
+    }
+
+    /**
+     * <p>
+     * dumps the GUI structure provided by the parameter into the log file. Calls itself
+     * recursively to traverse the GUI structure.
+     * </p>
+     *
+     * @param guiStructure the GUI structure to be logged
+     */
+    private void dumpGuiStructure(HtmlGUIElement guiStructure) {
+        dumpGuiElement(guiStructure);
+        
+        if (guiStructure.getChildren() != null) {
+            for (HtmlGUIElement child : guiStructure.getChildren()) {
+                dumpGuiStructure(child);
+            }
+        }
+    }
+
+    /**
+     * <p>
+     * dumps the GUI element provided by the parameter into the log file.
+     * </p>
+     *
+     * @param guiElement the GUI element to be logged
+     */
+    private void dumpGuiElement(HtmlGUIElement guiElement) {
+        if (!loggedGUIElements.contains(guiElement)) {
             outputWriter.print("<component id=\"");
             outputWriter.print(guiElement.getId());
@@ -301,5 +348,7 @@
             }
             
-            dumpParam("parent", parentId);
+            if (guiElement.getParent() != null) {
+                dumpParam("parent", guiElement.getParent().getId());
+            }
         
             outputWriter.println("</component>");
