[Seaside] Nested div rendering question

Ramon Leon ramon.leon at allresnet.com
Thu Oct 4 06:14:38 UTC 2007

> -----Original Message-----
> From: seaside-bounces at lists.squeakfoundation.org 
> [mailto:seaside-bounces at lists.squeakfoundation.org] On Behalf 
> Of Brian Brown
> Sent: Wednesday, October 03, 2007 9:06 PM
> To: Seaside - general discussion
> Subject: Re: [Seaside] Nested div rendering question
> Ok, here is an off the cuff screencast the demonstrates the 
> problem so we have easier context to talk about it: 
> http://www.techgame.net/ ~brian/evaluatorscreencast.mov (16mb 
> quicktime movie).

Two quick suggestions, one, like Lukas said, fire up firebug.  More
specifically, after ensuring there aren't any errors of any kind, under the
Net tab select XHR and look at the individual xml http responses coming
across and make sure they're both actually rendering the same JavaScript.
You assume they are, but are they really?  I rigged up a quick sample and
see the following... 

renderContentOn: html 
	(html div) id: #test1; with: [self renderRandomOn: html].
	(html div) id: #test2; with: [self renderRandomOn: html].
	(html button)
		onClick: ((html evaluator)
					callback: [:v | ] value: 'Dude';
					callback: [:s | 
							(s element) id:
#test1; render: [:r | self renderRandomOn: r].
							(s element) id:
#test2; render: [:r | self renderRandomOn: r]];
					return: false);
		with: 'test'

renderRandomOn: html 
	(html div) style: 'border:1px solid red;';
		with: [html text: 1000 atRandom asString.
			self renderRandomAgainOn: html]

renderRandomAgainOn: html 
	(html div) style: 'border:1px solid blue;'; with: 1000 atRandom

Looks to me like what you're doing in your renderActionButtonsOn and I'm
rendering two nested divs, but it works for me and the inner divs are
updated fine.  Looking at the actual response for the xml http request in
firebug I see this JavaScript rendered when I click the button...

$('test1').update('<div style="border:1px solid red;">715<div
style="border:1px solid blue;">666</div></div>');
$('test2').update('<div style="border:1px solid red;">151<div
style="border:1px solid blue;">244</div></div>')

Which is what I'd expect, both inner divs are updated.  BTW, nice looking
app, especially if you've gotten so far without Firebug.  Could be something
possibly screwy in your image or a bug.  I'd try to simplify the problem
down to a fileout you can directly share, it's really hard trying to figure
this stuff out without all of the code in a runnable form.

Ramon Leon

More information about the seaside mailing list