On Wed, Nov 30, 2011 at 8:38 PM, C.Rigby <cram.ri...@gmail.com> wrote:

> I'm developing a single page AJAX webapp with Tapestry 5 and Dojo.  I'd
> like
> to allow the forward and back browser buttons to work, as well as allowing
> users to share bookmarks within the app.  I've been reading up on using
> anchors to capture the application state.  Something like this in PHP:
>
> http://yensdesign.com/2008/11/creating-ajax-websites-based-on-anchor-navigation/
>
> Two questions:
> 1. Is there a "proper" way to implement anchor usage for AJAX webapps using
> Tapestry or should I just code all of the handlers in JS?  Tapestry seems
> very much geared for multi-page applications, but does incorporate some
> nice
> AJAX functionality for what I'm trying to accomplish.  I'm curious if
> anyone
> has successfully implemented something like this.
>

I've been thinking about it but haven't actually tried it. What I would use
is https://github.com/balupton/History.js/


>
> 2. Can the anchor context in a URL be retrieved from the onActivate()
> function of a page?  In other words, if I want to allow a user to bookmark
> a
> "page", can I set up the onActivate function to parse the incoming anchor
> tag and initialize the page appropriately.
>

I think history.js makes ajax calls using urls that you define (think about
making these url's as event links using ComponentResources) and you can
listen to events in a tapestry page/component.

The anchors are fallback for html4, I like the idea behind history.js
because it also covers html5 browsers without using anchors. So basically
think/work with them as states not just anchors in a url.

Hope it helps a bit.

Cheers


>
> Thanks for any guidance anyone can give!
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Tapestry5-Anchor-Usage-for-Navigation-tp5036547p5036547.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

Reply via email to