[Seaside] Seaside: children problem
Philippe Marschall
philippe.marschall at gmail.com
Mon Dec 31 11:13:52 UTC 2007
2007/12/29, an organic <seasidebeginner at gmail.com>:
> 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) ]]
This is your problem, (SubMenu new item: item) needs to be returned in
#children of Menu2.
Cheers
Philippe
> 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
> thisContextWARenderContinuation>>componentsNotFound:selfa
> WARenderContinuation aCollectionan Array(a SubMenu)
> thisContextWARenderContinuation>>unprocessedCallbacks:
> selfa WARenderContinuation aCollectionan Array(a WAActionCallback)ownersan
> Array(a SubMenu) eacha WAActionCallback
> thisContextWARenderContinuation>>processCallbacks: selfa
> WARenderContinuation aRequesta WARequest GET /seaside/sitelastPosition0
> callbackStreama WACallbackStreameacha WAToolFrame
> thisContext[] in WARenderContinuation>>handleRequest:
> {[self processCallbacks: aRequest]}self a WARenderContinuationaRequesta
> WARequest GET /seaside/site rnil
> thisContextBlockContext>>on:do: self[] in
> WARenderContinuation>>handleRequest: {[self
> processCallbacks: aRequest]}exceptionan ExceptionSet handlerAction[] in
> WARenderContinuation>>withNotificationHandler: {[:n | n]}
> handlerActivetrue
>
> I hope it's quite clear. Thnx for help
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
More information about the seaside
mailing list