[Seaside] Ajax Posting with JQuery: An example?
watchlala at hotmail.com
Thu Oct 6 02:51:11 UTC 2011
The child component should have an ajax callback, then. It doesn't need to be in a form necessarily.
It could look something like this:
html textInput callback: [:v | self doSomethingWithValue: v ]; onChange:/onBlur:/onEnter: (html jQuery ajax serializeThis).
That would serialize it, but I imagine you want it to do something, so you could further modify it this way:
html textInput callback: [ ... ]; onEnter: (html jQuery ajax serializeThis onSuccess: (html jQuery ajax script: [:s | s add: (self doSomethingOn: s) ].
> Date: Wed, 5 Oct 2011 20:43:40 -0400
> From: ljw1001 at gmail.com
> To: seaside at lists.squeakfoundation.org
> Subject: [Seaside] Ajax Posting with JQuery: An example?
> 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.
> seaside mailing list
> seaside at lists.squeakfoundation.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the seaside