[Seaside] something like #callback:value: but for #html: ?

Esteban Lorenzano estebanlm at gmail.com
Thu Jun 30 02:55:58 UTC 2011

I'm trying to fill an JQAccordion when user opens it, and I think the way to do that is by doing something like this: 

html div 
	script: ( 
		html jQuery new accordion
			active: self selectedIndex - 1;  
			autoHeight: false;  
			onChangestart: ((html jQuery new 
					alias: 'ui'; 
					access: 'newContent'; 
					call: 'load' with: (html jQuery ajax 
						html: [ :renderer | renderer text: 'TEST' ];
				asFunction: #(event ui)));
	with: [ 
		html div id: 'header1'; with: 'header1'.
		html div.
		html div id: 'header2'; with: 'header2'.
		html div ]

this example is working fine, but I'm always rendering 'TEST'. I need to discriminate which content I need to render, so I need the header id value. Using #callback:value I would call something like: 

	((html jQuery ajax 
		callback: [ :v | "Some code here" ]
			value: (html jQuery new 
				alias: 'ui'; 
				access: 'newHeader'; 
				call: 'attr' with: 'id'))
		asFunction: #(event ui))

but I don't have nothing similar with #html: .

of course, I can call first a callback who sets the "current header", then make an ajax call, but that's not efficient (two calls instead one).
so, I would like to have something like #html:value: 

does anybody knows how can I solve this problem?


More information about the seaside mailing list