Hmmm....Thought I'd get clever and just remove the history link from the HyperLink and assign it to null.
I think it's my History that's causing the problem. So, this is what the compiler had to say about that:
java.lang.AssertionError: targetHistoryToken must not be null, consider using Anchor instead
So, this starts to answer my question about the difference between an anchor and a hyperlink. I guess an anchor doesn't need to create a history token, where a HyperLink must?
GWT Anchor JavaDoc
GWT Hyperlink JavaDoc
Hyperlink: A widget that serves as an "internal" hyperlink. That is, it is a link to another state of the running application. When clicked, it will create a new history frame using History.newItem(java.lang.String), but without reloading the page.
Being a true hyperlink, it is also possible for the user to "right-click, open link in new window", which will cause the application to be loaded in a new window at the state specified by the hyperlink.
It does look like the improper handling of my History token was to blame for my quirkiness. Both the Button and Anchor without a history token provided the behavior I wanted:
So, I managed to fix the application by avoiding the original problem, which is really just an issue of how to properly use the GWT API, and more to the point, how to program
Java. So, the question remains, does anyone have a sample of code that uses the FocusWidget.addClickHandler to add an event handler to a GWT Hyperlink, since we can't use the deprecated ClickHandler???
BTW, it's been fun chatting with myself this Saturday afternoon. What a great thread: images, pictures, code, runtime bugs, compiler errors, hyperlinks, and all esoterically assembled without an answer to the original conundrum? A work of art to be admired by the romantics, if I do say so myself.
-Cameron McKenzie