Bingo! Thanks to your help I figured it out. The container of the
Hyperlink composite was an HTMLPanel. I couldn't use
HTMLPanel.add(Widget, String) because I had no "id"ed div in which to
add the widget. So I did the insert at the element level :
 
tabPanel.getElement().insertBefore( newTab.asWidget().getElement(),
addBeforeElement );
I never realized that this bypassed some essential GWT code...

I solved the problem by making tabPanel a FlowPanel inside the
HTMLPanel and inserting the tab widgets inside that flow panel via
add(Widget, int) :
    tabPanel.insert(newTab.asWidget(), beforeIndex);

This seems to work fine.

Re: Debugging tricks

Thanks a lot! I've been using Chrome Web Developer tools quite a bit,
but I didn't know enough about GWT's internal to look for __listener
or __eventBits. I'll watch out for these in the future.

Cheers,

    Philippe

On Mar 26, 10:07 am, Thomas Broyer <[email protected]> wrote:
> On Mar 26, 5:42 pm, PhilBeaudoin <[email protected]> wrote:
>
> > Thanks Thomas,
>
> > This seems to be exactly the problem I'm having. Although I have
> > absolutely no clue why the Hyperlinks are not "attached". The
> > Hyperlink is inside a Composide that I build using UiBinder. I take
> > care to call initWidget() This Hyperlink is then added to my tab panel
> > composite. Maybe this panel isn't attached to the DOM at that point,
> > but I don't think this should cause a problem? Any idea of what might
> > be going wrong?
>
> How are you adding the Hyperlink to your Composite? (I mean, could you
> show the code? the one from inside the Composite, that takes an
> Hyperlink as input and "adds it" so it's visible to the user)
>
> > Also, a quick question: How did you figure out that the hyperlinks
> > didn't sink the events? Which debugging tool are you using?
>
> I was using Chrome, because I had an idea of what the problem might be
> (as I was aware of the linked bug), but I could have used Internet
> Explorer.
> Chrome's Web Developer tools have this wonderful thing that they're
> able to tell you whether a given object has event listeners (and of
> course, which ones), and in this case there wasn't any.
> I then looked for a __listener and/or __eventBits expando property,
> because that's how GWT "binds event handlers" (done in widget's
> onAttach) and there wasn't, confirming onAttach() wasn't called on the
> widget. This is a symptom of adding the "widget" by just adding its
> getElement() to the DOM, instead of adding it to a container widget
> (some Panel).

-- 
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