Folks,

I've radically enhanced the robustness of Lift's Ajax support.

Previously, Lift's Ajax calls would silently fail and would not be retried.

Now, Ajax calls are retried 3 times (tunable in LiftRules.ajaxRetryCount).
The delay between calls is 2 ^ (cnt - 1) seconds.  So, the first retry will
be delayed 1 second, the second return will delayed 2 seconds, the third
return will be delayed 4 seconds, etc.

It's possible to have a spiffy "working ajax spinner" displayed during Ajax
calls.  LiftRules.ajaxStart: Can[() => JsCmd] and LiftRules.ajaxEnd: Can[()
=> JsCmd] control what's displayed.  So:
    /*
     * Show the spinny image when an Ajax call starts
     */
    LiftRules.ajaxStart =
      Full(() => LiftRules.jsArtifacts.show("ajax-loader").cmd)

    /*
     * Make the spinny image go away when it ends
     */
    LiftRules.ajaxEnd =
      Full(() => LiftRules.jsArtifacts.hide("ajax-loader").cmd)

Will show and hide an element with the id "ajax-loader"  If you have a
spinning animated GIF in that HTML, it will be shown/hidden during Ajax
transactions.

You can control what is displayed if the Ajax call fails with:

  LiftRules.ajaxDefaultFailure: Can[() => JsCmd] =
    Full(() => JsCmds.Alert(S.??("The server cannot be contacted at this
time")))

If you have a JSON call, you can have an optional customer error handler.
For example, if you've got a Comet Chat app, in your CometActor:

override def onJsonError: Can[JsCmd] = Full(Alert("Server communication
error.  Your chat message was not sent."))

Also, note that the calls made by the Comet long poll mechanism have their
own failure fallback and that's not changed.

There are some breaking changes in SHtml:
  ajaxCall() now takes and returns a JsExp (JavaScript Expression)
  ajaxInvoke() now returns a JsExp (not a String)

I've built off Charles' excellent idea of Location Groups in SiteMap.  You
can have Loc("foo", List("foo"), "Foo",* LocGroup("sales", "fun")*)

There's a new Menu snippet <lift:Menu.group group="sales"
a:class="menu"><li><menu:bind/></li></lift:Menu.group>

All the menu items in the "sales" group will be displayed inside an <li/>
and with the class attribute on the <a> tag set to "menu".

Thanks,

David

-- 
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to