[Seaside] How would you re-write this code to hide/show content

Mike me at mikehogan.net
Sat Jan 22 13:06:06 CET 2005

Wow, thats pretty clever!  It took me some time to understand all 
the moving parts.

One thing: Initially I did not add renderDiv2On and renderDiv3On 
methods, so I was not getting updates.  I modified 
WAStandardScripts to print out the contents of 
request.responseText, and I could then see that its a 
doesNotUnderstand debug page.  Makes sense.  So liveUpdate is 
swallowing debug pages.  Do you think this is correct?  Would it 
not be better if liveUpdate alerted the user if an exception page 
comes back, or just, more generally, if the regexp did not 

Thanks very much,

On Fri Jan 21 15:02:32 PST 2005, "Bany, Michel" <mbany at cincom.com> 

> You can also use a live callback like this
> 	renderContentOn: html
> 		html 			selectFromList: #(1 2 3) 			selected: #'1' 			callback: 
> [:v | ] 			labels: [:ea | ea asString]
> 			liveCallback:
> 				[:item :h |
> 				h spanNamed: 'selection' with: [ self renderDiv: item on: h 
> ]].
> 		html break.
> 		html spanNamed: 'selection' with: ''.
> 	renderDiv: divNumber on: html
> 		self perform: ('renderDiv' , divNumber asString , 'On:') 
> asSymbol with: html.
> 	renderDiv1On: html
> 		html divNamed: 'div1' with: 'div1 contents'.
> (this also uses some Javascript, see liveUpdate in 
> WAStandardScripts)
> Enjoy,
> Michel.
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/listinfo/seaside

More information about the Seaside mailing list