Real Hyperlinks

I am trying to create a site that is the best of both worlds. AJAX-enabled dynamic page updates but using “real” hyperlinks, not buttons styled to look like hyperlinks.

Why real hyperlinks? Two reasons:

  1. To allow all content of the site to be crawlable and indexable by search engines.
  2. To give the end user the options of right-clicking to open a link in a new tab as well as bookmarking the link and/or emailing it to a friend.

I know I can use the UriFragmentUtility to create hashtag bookmarks but that really doesn’t help either of the use cases above. If I am using Vaadin Buttons (which I suppose end up as a DIV or a SPAN), then search engines don’t know there’s any URL to crawl. And, again, if I am using Vaadin Buttons, end users can’t right-click to open the pseudo link i a new tab.

Alternative? I can use “real” hyperlinks that are mapped to different “Windows” (application windows, not sub-windows), but then I lose the responsiveness of in-place updates and, the brand new page (Window) has to completely download the entire Vaadin JavaScript libraries every time I click, none of which is cacheable as far as I can tell.

I have read about “Hijax” techniques for AJAX applications where real hyperlinks are used but a JavaScript event handler listens for the hyperlink to be clicked and then does some AJAX stuff with it, instead, and then returns false to keep the browser from actually fetching the requested hyperlink.

I was wondering if this was a technique that was even possible with Vaadin? The reason I’m not sure it even makes sense is, on one hand, I want the URL to actually return a completely formed page if the user right clicks and selects “Open link in a new tab” (or if a search engine actually submitted the link to the server). On the other hand, if the user just clicks it normally, I want Vaadin to transmit that as a buttonClick event to let me handle it the way I would handle such clicks normally.

I know I probably want the best of two incompatible worlds but I thought I would put it out there in case anyone had blazed this trail before me. Thanks in advance.

Checkout either the built-in Link component, or the more versatile
ActiveLink add-on
from the add-on Directory. At least the latter should fulfill your use case.