Thank you Vitali and Adam for you help, that is exactly what I needed to know - I'll try it out.
Joe On Sat, Apr 11, 2009 at 2:09 AM, Vitali Lovich <[email protected]> wrote: > public class MyHyperlink extends Hyperlink > { > public MyHyperlink(Element e) > { > super(e); > } > } > > Then find the Element you want using DOM or gquery & pass it to your the > constructor. Not sure why it's protected in Hyperlink. Then use the > handlers/listeners as for a regular widget. > > > On Sat, Apr 11, 2009 at 1:56 AM, Adam T <[email protected]> wrote: > >> >> Hi Joe, >> >> Maybe the History class can help you here. It allows you to pick a >> "token" off the url and change you applications status appropriately - >> a token is essentially everything after the hash (#) >> >> In the case where a user navigates to a url such as >> http://gwt.google.com/samples/Mail/Mail.html#foo the token would be >> "foo" and the history class would pick this up and act appropriately. >> Similarly when you click on your hyperlink it would change the URL >> from http://somthing to http://something#foo. >> >> A google search on gwt history should bring up a few tutorials (though >> they will most likely use GWT 1.5 and not the new GWT 1.6 syntax, but >> that should be OK for now - the new 1.6 syntax would use >> ValueChangeHandler<String> and the History.addValueChange() method >> instead of HistoryListeners classes and History.addHistoryListener() >> method - I'd suggest get used to the old approach before switching to >> the new one) >> >> Hope that helps, at least a bit! >> >> //Adam >> >> On 10 Apr, 14:46, Joe Hudson <[email protected]> wrote: >> > hello, >> > >> > I know this is a silly question but I haven't found a reference to >> > this... >> > >> > If I have links within the html document but outside of the GWT >> > application (see the #foo link below). How can I (or, is this >> > possible) to capture this event from within the GWT application? >> > >> > <body> >> > <a href="#foo">how can I get this link event in the GWT app?</a> >> > >> > <script type="text/javascript" language='javascript' >> > src='com.google.gwt.sample.mail.Mail.nocache.js'></script> >> > </body> >> > >> > Also, if I am coming to the app for the first time and I provide a >> > link likehttp://gwt.google.com/samples/Mail/Mail.html#foo >> > How, in the app would I know that the foo name was passed? >> > >> > Thank you very much for the help. >> > >> > Joe >> >> > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
