[Seaside] How to re-render a component including its callbacks

Johan Brichau johan at inceptive.be
Sat Sep 24 06:10:17 UTC 2011


Hi Frank,

It is useful that you let us know how you are replacing the list items in the onChange action of the radio button. 

My guess is that you are rerendering the individual items of the list but not the list itself (including the callback)?
For the callback to work correctly, you must also rerender the callback itself, hence the entire list.

This is the way the callbacks for entire list must work. There is also the option of associating a callback with each item in the list, which would mean that you can replace individual items of a list:

html select
	dispatchCallbacks;
	with: [
		html option
			callback: [ self firstClicked ];
			with: 'first'.
		html option
			callback: [ self secondClicked ];
			with: 'second'].


On 23 Sep 2011, at 16:33, squeakman wrote:

> I have a list, each item in the list has a callback
> 	html select id: 'items';
>             list: origItems; callback: [:returnedItem | ...]
> 
> I also have a radio button that switches the contents of the list on the fly (using onChange:).  I re-render the list with new items when the radio button is hit (using onChange:).
> 
> The contents of the list does change  but in the callback for the list, the "returnedItem" is the item from the original list. It is as if rendering the list left the initial callbacks unchanged.
> 
> Is there a way to re-render a component and have the callbacks use the new data?



More information about the seaside mailing list