Hi,<br><br>WAComponent subclass: #Site<br> instanceVariableNames: 'head menu'<br> classVariableNames: ''<br> poolDictionaries: ''<br> category: 'Pom'<br><br>children<br> ^ Array with: self head with: self menu
<br><br>initialize<br> super initialize.<br> <br> head := Head new.<br> menu := Menu2 new. <br><br>Is this info better?<br>But from menu2 in renderContentOn i call next Class WMenuItem which i want use to render my items.
<br>When i render items direct in menu2 component it works fine. But i want learn render items in next component (because items are hierarchical structure and WMenuItem can work recursively)<br><br>When i write render i think write in html to website ;).
<br><br>I thought that problem is here: menu2 dont have dynamically created WMenuItem in his children array. But i am not able to add it into this array (children of menu2). When i change code renderContentOn of Menu2:<br>
<br>renderContentOn: html <br> | temp |<br> html<br> unorderedList: [items do: [:item | <span style="font-weight: bold;">temp := WMenuItem new. self children: self children, temp.</span> html div class: 'a'; with: (temp kategorie: item) ]]
<br><br>i get this error:<br><h2>Error: Instances of WMenuItem are not indexable</h2><br><br><br><div><span class="gmail_quote">2007/12/29, Rajeev Lochan <<a href="mailto:lochan94@gmail.com">lochan94@gmail.com</a>>:
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">hi,<br>Have you defined/declared menu as an instance variable in class Site (I hope thats the class n ame for the first set of code). It would be clear if you can provide that info.
<br><br>The error you have got is due to the fact that the method
<br>children<br>^ Array with: menu<br><br>is not triggered properly. <br><br>Update if you still encounter any problem,<br>Hope that helps,<br>Rajeev<br><br><div class="gmail_quote"><div><span class="e" id="q_11726a371ae0fe6e_1">
On Dec 29, 2007 5:48 PM, an organic <
<a href="mailto:seasidebeginner@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">seasidebeginner@gmail.com</a>> wrote:<br></span></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><span class="e" id="q_11726a371ae0fe6e_3">Hello,
<br><br>i am new with seaside and i want make this demo:<br><br>class Site root component:<br><br>children<br> ^ Array with: self menu<br><br>renderContentOn: html<br> html div class: 'site'; with: [<br>
html div class: 'menu'; with: self menu. <br> ]<br><br>initialize<br> super initialize.<br><br> menu := Menu2 new.<br><br>+canberoot and accessors for menu<br><br><br>class Menu2 instance variables: items
<br>initialize<br> super initialize.<br> items := OrderedCollection new.<br> items<br> add: (Item new value: '1').<br> items<br> add: (Item new value: '2').<br> items<br> add: (Item new value: '3')
<br><br>renderContentOn: html <br> html<br> unorderedList: [items do: [:item | html div class: 'a'; with: (SubMenu new item: item) ]]<br><br>class Item instanceVar value<br>renderContentOn: html<br> html text: value.
<br><br><br><br>WAComponent subclass: #SubMenu<br> instanceVariableNames: 'item itemEditor'<br> classVariableNames: ''<br> poolDictionaries: ''<br> category: 'Pom'<br><br>editItem: aItem
<br> self itemEditor item: aItem copy.<br> (self call: self itemEditor)<br> ifTrue: [aItem copyFrom: self itemEditor item]<br><br>initialize<br> super initialize.<br> <br> itemEditor := ItemEditor new.
<br><br>renderContentOn: html <br> html<br> listItem: [html text: ' a ' , self item value.<br> html anchor<br> callback: [self editItem: self item];<br> with: 'e']
<br><br>and itemEditor, i think editors is fine. <br><br>i think problem is in menu2 when i create new object subMenu because when i click on 'e' and i want edit item i get error:<br><br><h3>Possible Causes</h3><ul>
<li>you do not implement #children correctly</li><li>you do not backtrack #children correctly</li><li>you do not implement #states correctly</li></ul><h3>Stack Trace</h3><ol><li><dl><dt><a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&3" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
thisContext</a></dt><dd>WARenderContinuation>>componentsNotFound:</dd><dt><a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&4" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
self</a></dt><dd>a WARenderContinuation
</dd><dt><a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&5" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
aCollection</a></dt><dd>an Array(a SubMenu)</dd></dl></li><li><dl><dt><a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&6" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
thisContext</a></dt><dd>WARenderContinuation>>unprocessedCallbacks:
</dd><dt><a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&7" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">self</a></dt><dd>a WARenderContinuation</dd><dt><a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&8" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
aCollection</a></dt><dd>an Array(a WAActionCallback)</dd><dt><a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&9" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">owners
</a></dt><dd>an Array(a SubMenu)</dd><dt><a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&10" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
each</a></dt><dd>a WAActionCallback</dd></dl></li><li><dl><dt><a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&11" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
thisContext</a></dt><dd>WARenderContinuation>>processCallbacks:
</dd>
<dt><a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&12" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">self</a></dt><dd>a WARenderContinuation</dd><dt><a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&13" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
aRequest</a></dt><dd>a WARequest GET /seaside/site</dd><dt><a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&14" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">lastPosition
</a></dt><dd>0</dd><dt><a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&15" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
callbackStream</a></dt><dd>a WACallbackStream</dd><dt><a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&16" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">each</a>
</dt><dd>a WAToolFrame</dd></dl></li><li><dl><dt><a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&17" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
thisContext</a></dt><dd>[] in WARenderContinuation>>handleRequest: {[self processCallbacks: aRequest]}</dd><dt><a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&18" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
self</a></dt><dd>
a WARenderContinuation</dd><dt><a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&19" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">aRequest</a></dt><dd>a WARequest GET /seaside/site
</dd><dt><a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&20" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
r</a></dt><dd>nil</dd></dl></li><li><dl><dt><a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&21" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">thisContext</a></dt>
<dd>BlockContext>>on:do:</dd><dt><a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&22" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
self</a></dt><dd>[] in WARenderContinuation>>handleRequest: {[self processCallbacks: aRequest]}</dd><dt><a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&23" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
exception
</a></dt><dd>an ExceptionSet
</dd><dt><a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&24" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">handlerAction</a></dt><dd>[] in WARenderContinuation>>withNotificationHandler: {[:n | n]}
</dd><dt><a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&25" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
handlerActive</a></dt><dd>true</dd></dl></li></ol><br><br>I hope it's quite clear. Thnx for help<br>
<br></span></div>_______________________________________________<br>seaside mailing list<br><a href="mailto:seaside@lists.squeakfoundation.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">seaside@lists.squeakfoundation.org
</a><br><a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br><br></blockquote></div><br><br clear="all"><br>-- <br>Rajeev Lochan<br><br>Co-founder, AR-CAD.com<br><br><a href="http://www.ar-cad.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.ar-cad.com
</a><br>+91 9243468076 (Bangalore)<br>080 65355873
<br>_______________________________________________<br>seaside mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org
</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
</a><br><br></blockquote></div><br>