[Seaside] Seaside: children problem

an organic seasidebeginner at gmail.com
Sat Dec 29 12:18:51 UTC 2007


Hello,

i am new with seaside and i want make this demo:

class Site root component:

children
    ^ Array with: self menu

renderContentOn: html
    html div class: 'site'; with: [
        html div class: 'menu'; with: self menu.
        ]

initialize
    super initialize.

    menu := Menu2 new.

+canberoot and accessors for menu


class Menu2 instance variables: items
initialize
    super initialize.
    items := OrderedCollection new.
    items
        add: (Item new value: '1').
    items
        add: (Item new value: '2').
    items
        add: (Item new value: '3')

renderContentOn: html
    html
        unorderedList: [items do: [:item | html div class: 'a'; with:
(SubMenu new item: item) ]]

class Item instanceVar value
renderContentOn: html
    html text: value.



WAComponent subclass: #SubMenu
    instanceVariableNames: 'item itemEditor'
    classVariableNames: ''
    poolDictionaries: ''
    category: 'Pom'

editItem: aItem
    self itemEditor item: aItem copy.
    (self call: self itemEditor)
        ifTrue: [aItem copyFrom: self itemEditor item]

initialize
    super initialize.

    itemEditor := ItemEditor new.

renderContentOn: html
    html
        listItem: [html text: ' a ' , self item value.
            html anchor
                callback: [self editItem: self item];
                 with: 'e']

and itemEditor, i think editors is fine.

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:

Possible Causes

   - you do not implement #children correctly
   - you do not backtrack #children correctly
   - you do not implement #states correctly

Stack Trace

   1. thisContext<http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&3>
   WARenderContinuation>>componentsNotFound:self<http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&4>a
   WARenderContinuationaCollection<http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&5>an
   Array(a SubMenu)
   2. thisContext<http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&6>
   WARenderContinuation>>unprocessedCallbacks:self<http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&7>a
   WARenderContinuationaCollection<http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&8>an
   Array(a WAActionCallback)owners<http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&9>an
   Array(a SubMenu)each<http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&10>a
   WAActionCallback
   3. thisContext<http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&11>
   WARenderContinuation>>processCallbacks:self<http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&12>a
   WARenderContinuationaRequest<http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&13>a
   WARequest GET
/seaside/sitelastPosition<http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&14>
   0callbackStream<http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&15>a
   WACallbackStreameach<http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&16>a
   WAToolFrame
   4. thisContext<http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&17>[]
   in WARenderContinuation>>handleRequest: {[self processCallbacks: aRequest]}
   self<http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&18>a
   WARenderContinuationaRequest<http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&19>a
   WARequest GET
/seaside/siter<http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&20>
   nil
   5. thisContext<http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&21>
   BlockContext>>on:do:self<http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&22>[]
   in WARenderContinuation>>handleRequest: {[self processCallbacks: aRequest]}
   exception<http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&23>an
   ExceptionSethandlerAction<http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&24>[]
   in WARenderContinuation>>withNotificationHandler: {[:n | n]}
   handlerActive<http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&_k=aILgLVQn&25>
   true



I hope it's quite clear. Thnx for help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20071229/b3af9f4f/attachment.htm


More information about the seaside mailing list