<div>I know that this is probably a very bad practice, but I have initialized component, eg. a instance variable &#39;bodyComp&#39;</div>
<div>&nbsp;</div>
<div>ok, I will show some code:</div>
<div>&nbsp;</div>
<div>RootComponent&gt;&gt;initilaize</div>
<div>&nbsp;&nbsp; super initialize.</div>
<div>&nbsp;&nbsp; self bodyComp: BodyComponent new.</div>
<div>&nbsp;</div>
<div>RootComponent&gt;&gt;renderContentOn: html</div>
<div>&nbsp;&nbsp; &quot;all the head stuff&quot;</div>
<div>&nbsp;&nbsp;&nbsp; bodyComponent renderContentOn: html</div>
<div>&nbsp;&nbsp;&nbsp; &quot;etc.&quot;</div>
<div>&nbsp;</div>
<div>I was wonderering how this was &quot;correctley&quot; done the other day, so I&#39;m glad this thread popped up..&nbsp; What is bad about my method, if anything, I just think it seems a little hackish...</div>
<div>ty</div>
<div><br><br>&nbsp;</div>
<div class="gmail_quote">On Mon, Apr 28, 2008 at 9:27 AM, John Thornborrow &lt;<a href="mailto:john@pinesoft.co.uk">john@pinesoft.co.uk</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Yes, that was what I intended, my example was merely a demonstration of #onAnswer:<br><font color="#888888"><br>
John.</font> 
<div>
<div></div>
<div class="Wj3C7c"><br><br>Lukas Renggli wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px; BORDER-LEFT: #ccc 1px solid">
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px; BORDER-LEFT: #ccc 1px solid">&nbsp;MyParentComponent&gt;&gt;renderContentOn: html<br>&nbsp;html render: (<br>&nbsp; &nbsp;ChildComponentA new<br>&nbsp; &nbsp; &nbsp;onAnswer: [ :val | self answer: val ];<br>
&nbsp; &nbsp; &nbsp;yourself).<br>&nbsp;html render: (<br>&nbsp; &nbsp;ChildComponentB new<br>&nbsp; &nbsp; &nbsp;onAnswer: [ :val | self answer: val];<br>&nbsp; &nbsp; &nbsp;yourself)<br></blockquote><br>No component instantiation in the render method! Like this you get new<br>components every time you hit refresh or perform an action on the<br>
page. This certainly does not work as expected.<br><br>You probably want something like this:<br><br>MyPageComponent&gt;&gt;initialize<br>&nbsp; &nbsp;super initialize.<br>&nbsp; &nbsp;childA := ChildComponentA new<br>&nbsp; &nbsp; &nbsp; onAnswer: [ :val | self answer: val ];<br>
&nbsp; &nbsp; &nbsp; yourself.<br>&nbsp; &nbsp;childB := ChildComponentB new<br>&nbsp; &nbsp; &nbsp; onAnswer: [ :val | self answer: val ];<br>&nbsp; &nbsp; &nbsp; yourself.<br><br>MyPageComponent&gt;&gt;children<br>&nbsp; &nbsp;^ Array with: childA with: childB<br><br>MyPageComponent&gt;&gt;renderContentOn: html<br>
&nbsp; &nbsp;html render: childA.<br>&nbsp; &nbsp;html render: childB<br><br>Lukas<br><br></blockquote><br>-- <br></div></div>
<div class="Ih2E3d">John Thornborrow<br><a href="http://www.pinesoft.co.uk/" target="_blank">http://www.pinesoft.co.uk</a><br><br><br>******************************************************************************************************************************************<br>
This email is from Pinesoft Limited. Its contents are confidential to the intended recipient(s) at the email address(es) to which it has been addressed. It may not be disclosed to or used by anyone other than the addressee(s), nor may it be copied in anyway. If received in error, please contact the sender, then delete it from your system. Although this email and attachments are believed to be free of virus, or any other defect which might affect any computer or IT system into which they are received and opened, it is the responsibility of the recipient to ensure that they are virus free and no responsibility is accepted by Pinesoft for any loss or damage arising in any way from receipt or use thereof. *******************************************************************************************************************************************<br>
<br><br>Pinesoft Limited are registered in England, Registered number: 2914825. Registered office: 266-268 High Street, Waltham Cross, Herts, EN8 7EA<br>_______________________________________________<br></div>
<div>
<div></div>
<div class="Wj3C7c">seaside mailing list<br><a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br><a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>David Zmick<br>/dz0004455\<br><a href="http://dz0004455.googlepages.com">http://dz0004455.googlepages.com</a><br><a href="http://dz0004455.blogspot.com">http://dz0004455.blogspot.com</a>