Good day, I am facing a really strange problem with IE, which I think
it is caused by the addDomHandler, but I am not sure of this.

We are creating a huge application, and my task is to create a button
with Rounded corners, I created the new Button with basically is a
DecoratorButton, that supports ClickListseners( or the new
ClickHandlers), and MouseListeners and FocusListeners as well.
Everything was perfect until we detect a really strange bug, which I
have try to locate but so far I have'nt had such luck.

What is happening, is that every time I just put my pointer over my
new button, the widget which the button directly interacts
dissapear!!!, this is not for all the widgets though, apparently only
on FlexTable and other widgets as well, also this only happens on IE8,
not in Firefox or Chrome or Safari. And when this happens there is no
problem detected in the log, not even an exception.

Does anyone have any clue of the possible reason for this? I am
sending part of my code... Thank you very much for your help.

If I set a normal button instead of the new Button, this doesnt seem
to happen. It happens with all the Panels which I tried to make them
to Handle Click and Mouse events. I am using GWT 1.6.

public class CustomDecoratorPanel extends DecoratorPanel implements
HasFocus, SourcesClickEvents, SourcesMouseEvents,
      SourcesMouseWheelEvents, HasAllMouseHandlers, HasClickHandlers,
HasAllKeyHandlers, HasAllFocusHandlers
{
   /**
    * The default style name.
    */
   private static final String   DEFAULT_STYLENAME      = "gwt-
DecoratorPanel";

   /**
    * The default styles applied to each row.
    */
   private static final String[] DEFAULT_ROW_STYLENAMES =
{"customTop", "customMiddle", "customBottom"};

   static final FocusImpl        impl                   =
FocusImpl.getFocusImplForPanel();

   /**
    * Create a new row with a specific style name. The row will
contain three
    * cells (Left, Center, and Right), each prefixed with the
specified style
    * name.
    *
    * This method allows Widgets to reuse the code on a DOM level,
without
    * creating a DecoratorPanel Widget.
    *
    * @param styleName
    *           the style name
    * @return the new row {...@link Element}
    */
   static Element createTR(String styleName)
   {
      Element trElem = DOM.createTR();
      setStyleName(trElem, styleName);
      if (LocaleInfo.getCurrentLocale().isRTL())
      {
         DOM.appendChild(trElem, createTD(styleName + "Right"));
         DOM.appendChild(trElem, createTD(styleName + "Center"));
         DOM.appendChild(trElem, createTD(styleName + "Left"));
      }
      else
      {
         DOM.appendChild(trElem, createTD(styleName + "Left"));
         DOM.appendChild(trElem, createTD(styleName + "Center"));
         DOM.appendChild(trElem, createTD(styleName + "Right"));
      }
      return trElem;
   }

   /**
    * Create a new table cell with a specific style name.
    *
    * @param styleName
    *           the style name
    * @return the new cell {...@link Element}
    */
   private static Element createTD(String styleName)
   {
      Element tdElem = DOM.createTD();
      Element inner = DOM.createDiv();
      DOM.appendChild(tdElem, inner);
      setStyleName(tdElem, styleName);
      setStyleName(inner, styleName + "Inneri");
      return tdElem;
   }

   /**
    * The container element at the center of the panel.
    */
   private Element containerElem;

   /**
    * The table body element.
    */
   private Element tbody;

   /**
    * Create a new {...@link DecoratorPanel}.
    */
   public CustomDecoratorPanel()
   {
      this(DEFAULT_ROW_STYLENAMES, 1);
   }

   /**
    * Creates a new panel using the specified style names to apply to
each row.
    * Each row will contain three cells (Left, Center, and Right). The
Center
    * cell in the containerIndex row will contain the {...@link Widget}.
    *
    * @param rowStyles
    *           an array of style names to apply to each row
    * @param containerIndex
    *           the index of the container row
    */
   CustomDecoratorPanel(String[] rowStyles, int containerIndex)
   {
      //super(DOM.createTable());

      // Add a tbody
      Element table = getElement();
      tbody = DOM.createTBody();
      DOM.appendChild(table, tbody);
      DOM.setElementPropertyInt(table, "cellSpacing", 0);
      DOM.setElementPropertyInt(table, "cellPadding", 0);

      // Add each row
      for (int i = 0; i < rowStyles.length; i++)
      {
         Element row = createTR(rowStyles[i]);
         DOM.appendChild(tbody, row);
         if (i == containerIndex)
         {
            containerElem = DOM.getFirstChild(DOM.getChild(row, 1));
         }
      }

      // Set the overall style name
      setStyleName(DEFAULT_STYLENAME);
   }

   /**
    * Get a specific Element from the panel.
    *
    * @param row
    *           the row index
    * @param cell
    *           the cell index
    * @return the Element at the given row and cell
    */
   protected Element getCellElement(int row, int cell)
   {
      Element tr = DOM.getChild(tbody, row);
      Element td = DOM.getChild(tr, cell);
      return DOM.getFirstChild(td);
   }

   /**
    * {...@inheritdoc}
    */
   protected Element getContainerElement()
   {
      return containerElem;
   }

   /**
    * {...@inheritdoc}
    */
   public int getTabIndex()
   {
      return impl.getTabIndex(getElement());
   }

   /**
    * {...@inheritdoc}
    */
   public void setAccessKey(char key)
   {
      impl.setAccessKey(getElement(), key);
   }

   /**
    * {...@inheritdoc}
    */
   public void setFocus(boolean focused)
   {
      if (focused)
      {
         impl.focus(getElement());
      }
      else
      {
         impl.blur(getElement());
      }
   }

   /**
    * {...@inheritdoc}
    */
   public void setTabIndex(int index)
   {
      impl.setTabIndex(getElement(), index);
   }

   /**
    * {...@inheritdoc}
    */
   public void addFocusListener(FocusListener listener)
   {
      ListenerWrapper.WrappedFocusListener.add(this, listener);
   }

   /**
    * {...@inheritdoc}
    */
   public void removeFocusListener(FocusListener listener)
   {
      ListenerWrapper.WrappedFocusListener.remove(this, listener);

   }

   /**
    * {...@inheritdoc}
    */
   public void addKeyboardListener(KeyboardListener listener)
   {
      ListenerWrapper.WrappedKeyboardListener.add(this, listener);
   }

   /**
    * {...@inheritdoc}
    */
   public void removeKeyboardListener(KeyboardListener listener)
   {
      ListenerWrapper.WrappedKeyboardListener.remove(this, listener);
   }

   /**
    * {...@inheritdoc}
    */
   public void addClickListener(ClickListener listener)
   {
      ListenerWrapper.WrappedClickListener.add(this, listener);
   }

   /**
    * {...@inheritdoc}
    */
   public void removeClickListener(ClickListener listener)
   {
      ListenerWrapper.WrappedClickListener.remove(this, listener);
   }

   /**
    * {...@inheritdoc}
    */
   public void addMouseListener(MouseListener listener)
   {
      ListenerWrapper.WrappedMouseListener.add(this, listener);
   }

   /**
    * {...@inheritdoc}
    */
   public void removeMouseListener(MouseListener listener)
   {
      ListenerWrapper.WrappedMouseListener.remove(this, listener);
   }

   /**
    * {...@inheritdoc}
    */
   public void addMouseWheelListener(MouseWheelListener listener)
   {
      ListenerWrapper.WrappedMouseWheelListener.add(this, listener);

   }

   /**
    * {...@inheritdoc}
    */
   public void removeMouseWheelListener(MouseWheelListener listener)
   {
      ListenerWrapper.WrappedMouseWheelListener.remove(this,
listener);

   }

   /**
    * {...@inheritdoc}
    */
   public HandlerRegistration addMouseDownHandler(MouseDownHandler
handler)
   {
      return addDomHandler(handler, MouseDownEvent.getType());
   }

   /**
    * {...@inheritdoc}
    */
   public HandlerRegistration addMouseUpHandler(MouseUpHandler
handler)
   {
      return addDomHandler(handler, MouseUpEvent.getType());
   }

   /**
    * {...@inheritdoc}
    */
   public HandlerRegistration addMouseOutHandler(MouseOutHandler
handler)
   {
      return addDomHandler(handler, MouseOutEvent.getType());
   }

   /**
    * {...@inheritdoc}
    */
   public HandlerRegistration addMouseOverHandler(MouseOverHandler
handler)
   {
      return addDomHandler(handler, MouseOverEvent.getType());
   }

   /**
    * {...@inheritdoc}
    */
   public HandlerRegistration addMouseMoveHandler(MouseMoveHandler
handler)
   {
      return addDomHandler(handler, MouseMoveEvent.getType());
   }

   /**
    * {...@inheritdoc}
    */
   public HandlerRegistration addMouseWheelHandler(MouseWheelHandler
handler)
   {
      return addDomHandler(handler, MouseWheelEvent.getType());
   }

   /**
    * {...@inheritdoc}
    */
   public HandlerRegistration addClickHandler(ClickHandler handler)
   {
      return addDomHandler(handler, ClickEvent.getType());
   }

   /**
    * {...@inheritdoc}
    */
   public HandlerRegistration addKeyUpHandler(KeyUpHandler handler)
   {
      return addDomHandler(handler, KeyUpEvent.getType());
   }

   /**
    * {...@inheritdoc}
    */
   public HandlerRegistration addKeyDownHandler(KeyDownHandler
handler)
   {
      return addDomHandler(handler, KeyDownEvent.getType());
   }

   /**
    * {...@inheritdoc}
    */
   public HandlerRegistration addKeyPressHandler(KeyPressHandler
handler)
   {
      return addDomHandler(handler, KeyPressEvent.getType());
   }

   /**
    * {...@inheritdoc}
    */
   public HandlerRegistration addFocusHandler(FocusHandler handler)
   {
      return addDomHandler(handler, FocusEvent.getType());
   }

   /**
    * {...@inheritdoc}
    */
   public HandlerRegistration addBlurHandler(BlurHandler handler)
   {
      return addDomHandler(handler, BlurEvent.getType());
   }

   public void click()
   {
      getButtonElement().click();
   }

   private ButtonElement getButtonElement() {
      return getElement().cast();
    }
}

Thank you very much for your help again and if you need more
information please let my know.

Guillermo Sanchez
-- 
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.


Reply via email to