[Seaside] How to serialize jQuery UI Selectable?
aa at serendip.demon.co.uk
Fri Jan 29 08:56:17 UTC 2010
Thanks for replying so quickly! I should have posted the code to show what I'm referring to. This is from JQSelectableFunctionalTest, in Seaside 3.0a5:
script: (html jQuery new selectable
onStop: (html jQuery ajax
callback: [ :value | selected := value asSet ]
passengers: (html jQuery this find: '.ui-selected')));
self vegetables do: [ :each |
class: 'ui-selected' if: (selected includes: each);
with: each ] ]
While there is a callback, I can't figure out how to display the selected items.
For comparison, here is the code from Multi-Select-List, in JQFormFunctionalTest (I cleaned up the original code):
html fieldSet: [
html span: [
list: (1 to: 9);
callback: [ :value | multiSelectList := value ];
" update the paragraph "
((html jQuery this
find: 'p') load
" serialize all nearby form elements "
serialize: (html jQuery this
html: [ :h | h render: multiSelectList ]) ].
html paragraph: multiSelectList ]
This includes instructions to serialize the elements, but I'm having a lot of problems trying to do the same thing in the Selectable example.
I'd be grateful for your insight!
On Thu, 28 Jan 2010 23:36:35 +0100
Lukas Renggli <renggli at gmail.com> wrote:
> This demo does not go back to the server, that's purely client side.
> Have a look at JQSelectableFunctionalTest for a demo in Seaside that
> serializes back the selected elements to the server.
More information about the seaside