Re: In page (html) anchors don't work - they interfere with history tokens

2012-10-05 Thread tanteanni
thx i'll try it, until now i thought normal html works flawlessly within gwt webapp but in this case i am disabused. On Saturday, 22 September 2012 17:09:30 UTC+2, Andrei wrote: Something like this: myHTMLWidget.addClickHandler(new ClickHandler() { @Override public void

Re: In page (html) anchors don't work - they interfere with history tokens

2012-10-05 Thread tanteanni
can you explain how to use the html5 feature you mentioned? On Friday, 21 September 2012 16:55:51 UTC+2, Jens wrote: Have you tried to attach an event listener (DOM.addEventListener()) to these anchors and call ClickEvent.preventDefault() when you click on them? That could suppress the

Re: In page (html) anchors don't work - they interfere with history tokens

2012-10-05 Thread Jens
Someone else already explained it ;-) http://carlosaguayo.posterous.com/html5-history-in-gwt Also read the two comments on that page. -- J. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit

Re: In page (html) anchors don't work - they interfere with history tokens

2012-09-22 Thread Richard
That's quite something. The hashtag was originally meant for the use tanteanni intends (jumping to points within a document), but it's been so heavily abused that we now have to write workarounds to get the original behaviour back. On Friday, September 21, 2012 4:55:51 PM UTC+2, Jens wrote:

Re: In page (html) anchors don't work - they interfere with history tokens

2012-09-22 Thread Andrei
I think it is possible to attach a single ClickHandler to the HTML widget containing the HTML document. When clicked call preventDefault(), as Jen suggested, look at the source of the click, and if it is your anchor, scroll to the cursor position. On Friday, September 21, 2012 10:55:51 AM

Re: In page (html) anchors don't work - they interfere with history tokens

2012-09-22 Thread Andrei
Something like this: myHTMLWidget.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { event.preventDefault(); Element e = Element.as(event.getNativeEvent().getEventTarget()); if (e.getAttribute(href).contains(#)) {

In page (html) anchors don't work - they interfere with history tokens

2012-09-21 Thread tanteanni
This question could also be answered herehttp://stackoverflow.com/questions/12509969/gwt-and-in-page-hyperlinks-chapter3-interfere-with-history-tokens :-). I want to add a html-document to a view. the html page contains an toc with anchors a href=#Chapter1Chapter 1/a and a

Re: In page (html) anchors don't work - they interfere with history tokens

2012-09-21 Thread David
I'm not quite sure what you are trying to do. If your hrefs are meant to be page request then lose the hash. However if your hrefs are truly meant to be targeted as history tokens then you can try something like : g:InlineHyperlink targetHistoryToken=chapter1 ui:field=simpleTabChapter

Re: In page (html) anchors don't work - they interfere with history tokens

2012-09-21 Thread Jens
Have you tried to attach an event listener (DOM.addEventListener()) to these anchors and call ClickEvent.preventDefault() when you click on them? That could suppress the history change and you can scroll your html document yourself by reading the href attribute and searching the anchor you