[Seaside] Ajax Posting with JQuery: An example?

Larry White ljw1001 at gmail.com
Thu Oct 6 00:43:40 UTC 2011


I need to make an Ajax post using JQuery, with Seaside for my server.
I've found a number of Seaside JQuery examples (no posts though) and
lots of JQuery post examples (no seaside). In the JQuery examples you
specify the URL you're posting to, but that would be wrong in Seaside.

Here's the use case. I have a large table of data. Each cell contains
an anchor and clicking on the anchor converts the cell to a TextInput
field. Now I need to submit that field's value, in an Ajaxy way, so I
only refresh the single cell of the table.

A simplified version of the current code looks like this:

renderContentOn: html	
	| child |
	child := myTextEditor
				valueBlock: [ object value ]
				callback: [ :value | object setValue: value ]

	html anchor
     		onClick: ((html jQuery this) load  html: [ :r | r  render: child ]);
     		with: ( object value).	

I'm assuming the solution involves modifying the callback in my
'child' to post using JQuery.  if anyone could explain in a bit more
detail what the callback and the server code should look like it would
be a big help.

PS: It would also make a good addition to Dynamic Web Development with
Seaside's draft JQuery chapter so you'd probably be helping a lot of
people ;)

Thanks much.


More information about the seaside mailing list