[Seaside] Add button not showing it's page

Julian Fitzell julian at beta4.com
Wed Jul 28 07:32:31 CEST 2004


LK wrote:
> Sorry, I'm Larry Kelly.
> the addNewItem needs a #children method? What would go in it?  I'm 
> unclear what the #children method is for?  Sorry to be so dense.:)
> -Larry

Hi Larry, not a problem.

So a component's #children method is supposed to return an array of all 
the subcomponents it is currently displaying within itself.

Unfortunately it was me who was being dense for even mentioning it in 
this context: you don't need to implement a #children method when you 
call another component.  I think I must have confused myself between 
what you had been trying to do and the solution I was suggesting for you.

You could probably ignore all the #editorComponentFor: stuff I was 
talking about as well as #children for now and just implement addItem 
more like:

addItem
   self call: (PMLogItemEditor new item: PMLogItem new)

(noting again that you need to do something with the new item to store 
it somewhere presumably).

To explain #children a little more, since I brought it up, let's look at 
WAMultiCounter as an example that needs to implement #children.  It's 
render method looks like:

renderContentOn: html
	counters
		do: [:ea | html render: ea]
		separatedBy: [html horizontalRule]

and it implements #children as follows:

children
	^ counters

Seaside uses #children when handling callbacks, decorations, etc. to 
make sure each of the embedded components has its chance to do 
processing.  You can see some weird behaviour if you don't have 
#children properly defined in those cases.

Cheers,

Julian

-- 
   Julian Fitzell  --  Beta4 Productions
julian at beta4.com  --  http://www.beta4.com
Seaside: http://www.beta4.com/seaside2


More information about the Seaside mailing list