[Seaside] Callbacks on collection tags

Esteban A. Maringolo emaringolo at gmail.com
Mon Feb 4 18:01:24 UTC 2008


I'm having an issue with the use of collection tags (i.e. unordered
list), and Scriptaculous updater.

I can't specify and updater directly to the unorderedList.

For example:

renderContentOn: html
    html unorderedList
        list: myListOfItems
        onClick: (
		html updater
                 id: containerId;
                 callback: [:r | self renderHandlerOn: r]);
        callback: [:x | self onItemSelected: x].

In the previous example, the unordered list callback block, when
executed, knows the "selected" item.
But there's no way to know it in the updater block.

The only way I found to handle this, is to build the list explicitly:

    html unorderedList
	with: [
		myListOfItems do: [:each |
		html listItem
		        onClick: (
				html updater
		                 id: containerId;
		                 callback: [:r | self renderHandlerOf: each on: r]);
	        callback: [:x | self onItemSelected: x]
		]
	].


But perhaps I'm missing something.

Best regards,

-- 
Esteban A. Maringolo
eMaringolo at gmail.com


More information about the seaside mailing list