+1 for this approach but I'd rather opt it for JsCmd cases classes/
objects and not really S/SHtml methods.
case class AjaxHash extends JsCmd {
...
}
you got the idea.
Br's,
Marius
On Jan 14, 8:29 pm, David Pollak <[email protected]>
wrote:
> On Wed, Jan 13, 2010 at 6:02 PM, Alex Boisvert <[email protected]>wrote:
>
>
>
> > Just thinking out loud as to how this could work...
>
> > On modern browsers, it's possible to monitor the state change of the
> > browser's URL hash (aka window.location.hash / '#' / document fragment)
> > in the browser with the 'onhashchange' DOM event. It gets fired whenever
> > the location.hash changes. On older browsers, it's also possible to poll
> > for change which is less efficient but that's life.
>
> > So the idea would be to:
>
> > 1) add a snippet or utility method to set up a listener on onhashchangethat
> > would callback Scala functions associated with given hash (e.g. #foo,
> > #bar, ...). Hashes could support parameters too (e.g.,
> > #foo/:param1/:param2)
>
> > 2) add a method S.ajaxHash(hashPath, callback): JsCmd that would bind a
> > hash path/pattern to a Scala function (by registering the path/pattern with
> > the listener)
>
> > 3) add a method S.changeHash(hashPath, params): JsCmd to programmatically
> > change the browser's hash as a result of some AJAX processing.
>
> > I don't have time to work on this yet but I'd be happy to hear what others
> > think of the idea.
>
> I really like this approach... too bad you don't have time to work on it.
> :-(
>
>
>
>
>
> > alex
>
> > On Wed, Jan 13, 2010 at 2:45 PM, greekscala <[email protected]>wrote:
>
> >> Hello,
>
> >> I would really would like to have this type of support from lift.
> >> I looked at GWT and think this is a nice way. They use url parameters
> >> after a '#'. I dont understand the process because I have very little
> >> javascript knowledge.
>
> >> But I am thinking, lift is creating unique function names and is
> >> calling them with ajax.
> >> Maybe there is a way to have the functions be called over a way like
> >> GWT?
>
> >> Just creating some thoughts...
>
> >> best regards
>
> >> On 12 Jan., 13:23, greekscala <[email protected]> wrote:
> >> > Hello Timothy,
>
> >> > there is nothing stoping me from using it.
> >> > But when I think of a framework it would be nice to "activate"
> >> > backbutton support.
> >> > I think this is somethink a lot of people would appreciate to have and
> >> > not everybody
> >> > should have to build this from the ground up.
>
> >> > I do not have to deal with this now but in near future. I will have to
> >> > search
> >> > what ways are avalable. And if I can intergrate this im my app, maybe
> >> > we
> >> > can find a way to abstract it.
>
> >> > with best regards
>
> >> > On 12 Jan., 00:35, Timothy Perrett <[email protected]> wrote:
>
> >> > > I'm not sure what is stopping you using something like this in
> >> > > conjunction with lift?
>
> >> > > If you want something baked in, can you be specific with what and how
>
> >> > > you might want it to work?
>
> >> > > Cheers, Tim
>
> >> > > Sent from my iPhone
>
> >> > > On 11 Jan 2010, at 23:13, greekscala <[email protected]> wrote:
>
> >> > > > Hello Alex!
>
> >> > > > I will take a look at sammy.js .
> >> > > > I would like to have some way for this in Lift too.
> >> > > > Since with Lift it is easy to do alot of ajax.
>
> >> > > > with best regards
>
> >> > > > On 11 Jan., 23:05, Alex Boisvert <[email protected]> wrote:
> >> > > >> I've been playing with sammy.js <http://code.quirkey.com/sammy/>
> >> > > >> recently
> >> > > >> and I like the way they update the URL fragment identifier (hash)
> >> > > >> when doing
> >> > > >> AJAX which makes apps more back-button friendly, in a manner that's
>
> >> > > >> similar
> >> > > >> to GMail.
>
> >> > > >> It would be nice to have something similar in Lift.
>
> >> > > >> alex
>
> >> > > >> On Mon, Jan 11, 2010 at 4:55 PM, greekscala
> >> > > >> <[email protected]> wrote:
> >> > > >>> Hello Lift people!
>
> >> > > >>> I would like to know how experienced lift devs think and what they
>
> >> > > >>> do
> >> > > >>> about
> >> > > >>> ajax backbutton support.
>
> >> > > >>> with best regards
>
> >> > > >>> --
> >> > > >>> You received this message because you are subscribed to the Google
>
> >> > > >>> Groups
> >> > > >>> "Lift" group.
> >> > > >>> To post to this group, send email to [email protected].
> >> > > >>> To unsubscribe from this group, send email to
> >> > > >>> [email protected]<liftweb%[email protected]>
> >> <liftweb
> >> > > >>> %[email protected]>
> >> > > >>> .
> >> > > >>> For more options, visit this group at
> >> > > >>>http://groups.google.com/group/liftweb?hl=en.
> >> > > > --
> >> > > > You received this message because you are subscribed to the Google
> >> > > > Groups "Lift" group.
> >> > > > To post to this group, send email to [email protected].
> >> > > > To unsubscribe from this group, send email to
> >> [email protected]<liftweb%[email protected]>
> >> > > > .
> >> > > > For more options, visit this group athttp://
> >> groups.google.com/group/liftweb?hl=en
> >> > > > .
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "Lift" group.
> >> To post to this group, send email to [email protected].
> >> To unsubscribe from this group, send email to
> >> [email protected]<liftweb%[email protected]>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/liftweb?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<liftweb%[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/liftweb?hl=en.
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890
> Follow me:http://twitter.com/dpp
> Surf the harmonics
--
You received this message because you are subscribed to the Google Groups
"Lift" 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/liftweb?hl=en.