Curt Hibbs wrote:
> James G. Britt wrote:
> 
>>On Sat, 26 Feb 2005 06:45:34 +0900, Curt Hibbs <curt / hibbs.com> wrote:
>>
>>>I always have trouble remembering whether its HttpXmlRequest, or
>>>XmlHttpRequest. In either case, its a poor moniker for such a
>>
>>promising web
>>
>>>app technique.
>>
>>
>>It's not a technique per se, it's a the name of a JavaScript object
>>for doing sync/async calls from the browser to to server.  Been around
>> since the last century, first as part of  Internet Explorer, then
>>Mozilla.
> 
> 
> I know, but it hasn't gotten much attention until Google wowed us with
> Gmail, Google Maps, and Google Suggest. Ta-Da Lists uses this too, but its a
> one-off solution specific to that web app.
> 
> 
>>>Well, it turns out someone *has* given it a name: Ajax (for Asynchronous
>>>JavaScript + XML). You can read about it here:
>>
>>What struck me about this article was a)  it's sort of pretentious,
>>unless there is some reasonably  robust dev lib to go with it, since
>>people have been doing this for some time now, and b) you can't tell,
>>as there appears to be no code released, except what you can decipher
>>from your browser when poking around "Google suggest".
>>
>>BTW, I've done some work on a JSON-RPC ORB thing (called Roy, after
>>Roy Orbison) that builds off of the Ruby JSON-parsing code from
>>Florain Frank.  It makes this sort of JavaScript Xml request stuff
>>with Ruby server-code quite trivial.   You register services using
>>Needle and call them from the browser.
>>
>>I need to gem it up for a nice release so people can find bugs and stuff.
> 
> 
> Nice!
> 
> What I think we'll see someday, a new set of smart components integrated
> into web app frameworks that render GUI components in the browser that
> automatically know how to talk to their corresponding server-side objects
> for behind-the-scenes data transfer. This would make it much easier to build
> web apps whose GUI is as responsive as a desktop app (well... at least
> closer).

Hm, in Wee, this should be pretty easy (if someone can point me to an 
easy to use XxlHttpRequest client library, I'll try this out):

   # kind of pseudo-code... these things are not yet implemented

   class LiveUpdateCounter < Wee::Component

     def initialize(initial_count = 0)
       super()
       @count = initial_count
     end

     def render
       render_counter
       r.anchor.liveupdate_callback(:inc).with('++')
     end

     def inc
       @count += 1
       render_counter
     end

     def render_counter
       r.div.id('counter').with(@count)
     end

   end

Another interesting thing would be to observe the @count value and 
trigger render_counter automatically... So that you can write:

     def initialize
       @count = Observable.new(0).on_change { render_counter }
     end

     def render
       render_counter   # or @count.update
       r.anchor.liveupdate_callback(:inc).with('++')
     end

     def inc
       @count.value += 1
     end

Regards,

   Michael