[Seaside] Nested div rendering question

Brian Brown rbb at techgame.net
Thu Oct 4 04:06:19 UTC 2007

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).

The code I use in the tree component for the tree item anchors:


renderContentOn: html
	html anchor
		onClick: (html updater
			id: 'buttonLinkArea';
			callback: [:r | self onSelected. self renderButtonLinkEditorOn: r];
			onSuccess: (html evaluator
				callback: [:s |
					s element id: 'treeContentArea'; render: [:r | self tree parent  
parent renderTreeComponentOn: r].
					s element id: 'moveButtonArea'; render: [:r | self tree parent  
parent renderMoveButtonsOn: r].
					s element id: 'clipboardButtonsArea'; render: [:r | self tree  
parent parent renderClipboardButtonsOn: r]]));
		with: [wrappedObject renderSummaryOn: html]

Please note the callback that sets the #selectedNode in the callback,  
then renders the editor on the right hand side with  
#renderButtonLinkEditor: . Every time an item in the tree is clicked,  
the editor is updated and works great.

Here is the first part of ALWDDContentEditor>>renderActionButtonsOn:

renderActionButtonsOn: html
	html button class: 'editorControlSquareButton';
		onClick: (html evaluator
			callback: [:v | self buttonNewCategory] value: 'New Category';
			callback: self updateElementsBlock;
			return: false);
		disabled: self canButtonNewCategory not;
		with: 'New Category'.

... and the #updateElementsBlock

	^ [:s |
		s element id: 'treeContentArea'; render: [:r | self  
renderTreeComponentOn: r].
		s element id: 'moveButtonArea'; render: [:r | self  
renderMoveButtonsOn: r].
		s element id: 'buttonLinkArea'; render: [:r | self  
renderButtonLinkEditorOn: r].
		s element id: 'clipboardButtonsArea'; render: [:r | self  
renderClipboardButtonsOn: r]]

  - the difference being how the #renderButtonLinkEditorOn: is being  
invokes, either in the #callback: of the SUUpdater, or in a #render:  
of SUScript.

I hope this is a little clearer now!

Thank you for taking a look at this,

- Brian

On Oct 3, 2007, at 6:59 PM, Lukas Renggli wrote:

>> I have noticed the following; if I have a div as a container, and
>> some number divs inside of it, I can use SUUpdater to update the
>> outer div with the associated render method and all the nested divs
>> also render properly.
> As far as I know the SUUpdater always affects the contents of the  
> selected DIV.
>> If I use html evaluator to update the outer div, none of the internal
>> divs get rendered. Is this the expected behavior?
> Can you provide two examples? I don't exactly follow.
> Lukas
> -- 
> Lukas Renggli
> http://www.lukas-renggli.ch
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

More information about the seaside mailing list