[Seaside] How to serialize jQuery UI Selectable?

AA 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:

renderContentOn: html
	html unorderedList
		script: (html jQuery new selectable
			onStop: (html jQuery ajax
				callback: [ :value | selected := value asSet ]
				passengers: (html jQuery this find: '.ui-selected')));
		with: [
			self vegetables do: [ :each |
				html listItem
					class: 'ui-corner-all';
					class: 'ui-selected' if: (selected includes: each);
					passenger: 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):

renderContentOn: html
	html fieldSet: [
		html span: [
			html multiSelect
				size: 9;
				list: (1 to: 9);
				selected: multiSelectList;
				callback: [ :value | multiSelectList := value ];
				onChange: (
					" update the paragraph "
					((html jQuery this
						parents: 'fieldset';
						find: 'p') load
						" serialize all nearby form elements "
						serialize: (html jQuery this		
							parents: 'span';
							find: ':input'))
					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.
> Lukas

More information about the seaside mailing list