On Thu, Feb 14, 2013 at 9:00 PM, Grant Pitel <[email protected]> wrote:
> I am trying to create links in some html that call a  webservice (not
> external links) .  A couple of GWT examples on the internet show creating
> and anchor, attaching a click listener, then adding it to an HtmlPanel using
> the div id.  I cannot seem to get this to work in pyjs. Can some please
> confirm this bug or slap me for doing something stupid.  Either are
> welcomed. The example code below boils the problem as compactly as I can.

FYI: i believe some browsers will not show a hyperlink as expected
unless it has an href target.

im not sure about Anchor() ATM, but the Hyperlink() [a2] works fine...
the reason it's not working in your example is because you first bind
it to the HTMLPanel, THEN you add it to the RootPanel -- a widget can
only be attached to one thing.  when you attach to RootPanel,
internally the Hyperlink detaches itself from it's current parent,
then reattaches to it's new host/parent.

tl;dr, if you comment out:

RootPanel().add(a2) #works

...you will find:

RootPanel().add(html2) #does not work

...starts working :)

-- 

C Anthony

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Pyjs.org Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to