Tuesday, July 22, 2014

Javascript call from anchor's onclick is firing a ValueChangeEvent.

I have some HTML code that's invoking GWT code via JSNI.  The user clicks on an anchor in the HTML, which executes a bit of Javascript that calls one of my GWT methods.  That's all working as expected.

The problem is that the act of clicking the anchor is firing a ValueChangeEvent, and the PlaceHistoryHandler is telling the PlaceController to go to a new place.  I don't want to go to a new place every time an anchor is clicked.  I want to stay on the same place sometimes.  The GWT code being invoked by the Javascript should get to decide if I go to a new place or not.

Any suggestions or explanations?  I don't understand why any GWT events are being fired in the first place.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment