Seaside: children problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Seaside: children problem

Jakub-8
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
    WARenderContinuation>>componentsNotFound:
    self
    a WARenderContinuation
    aCollection
    an Array(a SubMenu)
  2. thisContext
    WARenderContinuation>>unprocessedCallbacks:
    self
    a WARenderContinuation
    aCollection
    an Array(a WAActionCallback)
    owners
    an Array(a SubMenu)
    each
    a WAActionCallback
  3. thisContext
    WARenderContinuation>>processCallbacks:
    self
    a WARenderContinuation
    aRequest
    a WARequest GET /seaside/site
    lastPosition
    0
    callbackStream
    a WACallbackStream
    each
    a WAToolFrame
  4. thisContext
    [] in WARenderContinuation>>handleRequest: {[self processCallbacks: aRequest]}
    self
    a WARenderContinuation
    aRequest
    a WARequest GET /seaside/site
    r
    nil
  5. thisContext
    BlockContext>>on:do:
    self
    [] in WARenderContinuation>>handleRequest: {[self processCallbacks: aRequest]}
    exception
    an ExceptionSet
    handlerAction
    [] in WARenderContinuation>>withNotificationHandler: {[:n | n]}
    handlerActive
    true


I hope it's quite clear. Thnx for help

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Seaside: children problem

Rajeev Lochan
hi,
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.

The error you have got is due to the fact that the method
children
^ Array with: menu

is not triggered properly.

Update if you still encounter any problem,
Hope that helps,
Rajeev

On Dec 29, 2007 5:48 PM, an organic < [hidden email]> wrote:
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
    WARenderContinuation>>componentsNotFound:
    self
    a WARenderContinuation
    aCollection
    an Array(a SubMenu)
  2. thisContext
    WARenderContinuation>>unprocessedCallbacks:
    self
    a WARenderContinuation
    aCollection
    an Array(a WAActionCallback)
    owners
    an Array(a SubMenu)
    each
    a WAActionCallback
  3. thisContext
    WARenderContinuation>>processCallbacks:
    self
    a WARenderContinuation
    aRequest
    a WARequest GET /seaside/site
    lastPosition
    0
    callbackStream
    a WACallbackStream
    each
    a WAToolFrame
  4. thisContext
    [] in WARenderContinuation>>handleRequest: {[self processCallbacks: aRequest]}
    self
    a WARenderContinuation
    aRequest
    a WARequest GET /seaside/site
    r
    nil
  5. thisContext
    BlockContext>>on:do:
    self
    [] in WARenderContinuation>>handleRequest: {[self processCallbacks: aRequest]}
    exception
    an ExceptionSet
    handlerAction
    [] in WARenderContinuation>>withNotificationHandler: {[:n | n]}
    handlerActive
    true


I hope it's quite clear. Thnx for help

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside




--
Rajeev Lochan

Co-founder, AR-CAD.com

http://www.ar-cad.com
+91 9243468076 (Bangalore)
080 65355873
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Seaside: children problem

Randal L. Schwartz
In reply to this post by Jakub-8
>>>>> "an" == an organic <[hidden email]> writes:

an> Hello,
an> i am new with seaside and i want make this demo:

an> class Site root component:

an> children
an>     ^ Array with: self menu

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

If you have a child component, from what I understand so far,
you want to call:

    html render: self menu

not

    html with: self menu

because #render: sets up additional framework things for the child.

(I could be wrong, and if so, Smarter People Than Me will correct me,
I presume.)

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[hidden email]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Seaside: children problem

Randal L. Schwartz
>>>>> "Randal" == Randal L Schwartz <[hidden email]> writes:

>>>>> "an" == an organic <[hidden email]> writes:
an> Hello,
an> i am new with seaside and i want make this demo:

an> class Site root component:

an> children
an> ^ Array with: self menu

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

Randal> If you have a child component, from what I understand so far,
Randal> you want to call:

Randal>     html render: self menu

Randal> not

Randal>     html with: self menu

Randal> because #render: sets up additional framework things for the child.

And I was wrong in that description as well.  You're sending
with: to a brush, not the canvas.  But my original intention applies. :)

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[hidden email]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Seaside: children problem

Jakub-8
In reply to this post by Rajeev Lochan
Hi,

WAComponent subclass: #Site
    instanceVariableNames: 'head menu'
    classVariableNames: ''
    poolDictionaries: ''
    category: 'Pom'

children
    ^ Array with: self head with: self menu

initialize
    super initialize.
   
    head := Head new.
    menu := Menu2 new.   

Is this info better?
But from menu2 in renderContentOn i call next Class WMenuItem which i want use to render my items.
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)

When i write render i think write in html to website ;).

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:

renderContentOn: html
    | temp |
    html
        unorderedList: [items do: [:item | temp := WMenuItem new. self children: self children, temp. html div class: 'a'; with:  (temp kategorie: item) ]]

i get this error:

Error: Instances of WMenuItem are not indexable




2007/12/29, Rajeev Lochan <[hidden email]>:
hi,
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.

The error you have got is due to the fact that the method
children
^ Array with: menu

is not triggered properly.

Update if you still encounter any problem,
Hope that helps,
Rajeev

On Dec 29, 2007 5:48 PM, an organic < [hidden email]> wrote:
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. <a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&amp;_k=aILgLVQn&amp;3" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> thisContext
    WARenderContinuation>>componentsNotFound:
    <a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&amp;_k=aILgLVQn&amp;4" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> self
    a WARenderContinuation
    <a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&amp;_k=aILgLVQn&amp;5" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> aCollection
    an Array(a SubMenu)
  2. <a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&amp;_k=aILgLVQn&amp;6" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> thisContext
    WARenderContinuation>>unprocessedCallbacks:
    <a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&amp;_k=aILgLVQn&amp;7" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">self
    a WARenderContinuation
    <a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&amp;_k=aILgLVQn&amp;8" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> aCollection
    an Array(a WAActionCallback)
    <a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&amp;_k=aILgLVQn&amp;9" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">owners
    an Array(a SubMenu)
    <a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&amp;_k=aILgLVQn&amp;10" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> each
    a WAActionCallback
  3. <a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&amp;_k=aILgLVQn&amp;11" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> thisContext
    WARenderContinuation>>processCallbacks:
    <a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&amp;_k=aILgLVQn&amp;12" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">self
    a WARenderContinuation
    <a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&amp;_k=aILgLVQn&amp;13" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> aRequest
    a WARequest GET /seaside/site
    <a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&amp;_k=aILgLVQn&amp;14" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">lastPosition
    0
    <a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&amp;_k=aILgLVQn&amp;15" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> callbackStream
    a WACallbackStream
    <a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&amp;_k=aILgLVQn&amp;16" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">each
    a WAToolFrame
  4. <a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&amp;_k=aILgLVQn&amp;17" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> thisContext
    [] in WARenderContinuation>>handleRequest: {[self processCallbacks: aRequest]}
    <a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&amp;_k=aILgLVQn&amp;18" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> self
    a WARenderContinuation
    <a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&amp;_k=aILgLVQn&amp;19" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">aRequest
    a WARequest GET /seaside/site
    <a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&amp;_k=aILgLVQn&amp;20" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> r
    nil
  5. <a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&amp;_k=aILgLVQn&amp;21" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">thisContext
    BlockContext>>on:do:
    <a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&amp;_k=aILgLVQn&amp;22" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> self
    [] in WARenderContinuation>>handleRequest: {[self processCallbacks: aRequest]}
    <a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&amp;_k=aILgLVQn&amp;23" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> exception
    an ExceptionSet
    <a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&amp;_k=aILgLVQn&amp;24" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">handlerAction
    [] in WARenderContinuation>>withNotificationHandler: {[:n | n]}
    <a href="http://localhost:8080/seaside/site?_s=sVPLwysvyCJwWnRw&amp;_k=aILgLVQn&amp;25" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> handlerActive
    true


I hope it's quite clear. Thnx for help

_______________________________________________
seaside mailing list
[hidden email]
<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




--
Rajeev Lochan

Co-founder, AR-CAD.com

<a href="http://www.ar-cad.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> http://www.ar-cad.com
+91 9243468076 (Bangalore)
080 65355873
_______________________________________________
seaside mailing list
[hidden email]
<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



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Seaside: children problem

Randal L. Schwartz
In reply to this post by Randal L. Schwartz
>>>>> "Randal" == Randal L Schwartz <[hidden email]> writes:

Randal> If you have a child component, from what I understand so far,
Randal> you want to call:

Randal>     html render: self menu

Randal> not

Randal>     html with: self menu

Randal> because #render: sets up additional framework things for the child.

Randal> (I could be wrong, and if so, Smarter People Than Me will correct me,
Randal> I presume.)

Oops.  Sorry.  aCanvas>>#render: and aBrush>>#with: both end up
calling anObject>>#renderOn: in roughly the same way.  Nevermind.

/me hangs head in shame, and promises to research a bit more before
posting next time.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[hidden email]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Seaside: children problem

Philippe Marschall
In reply to this post by Jakub-8
2007/12/29, an organic <[hidden email]>:

> 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
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Seaside: children problem

Philippe Marschall
In reply to this post by Jakub-8
2007/12/29, an organic <[hidden email]>:

> Hi,
>
> WAComponent subclass: #Site
>     instanceVariableNames: 'head menu'
>     classVariableNames: ''
>     poolDictionaries: ''
>     category: 'Pom'
>
> children
>     ^ Array with: self head with: self menu
>
> initialize
>     super initialize.
>
>     head := Head new.
>     menu := Menu2 new.
>
> Is this info better?
> But from menu2 in renderContentOn i call next Class WMenuItem which i want
> use to render my items.
> 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)
>
> When i write render i think write in html to website ;).
>
> 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:
>
> renderContentOn: html
>     | temp |
>     html
>         unorderedList: [items do: [:item | temp := WMenuItem new. self
> children: self children, temp. html div class: 'a'; with:  (temp kategorie:
> item) ]]

#, is the concatenation "operator", it concatenates two collections.
temp is not a collection but an instance of WMenuItem.

Cheers
Philipppe

> i get this error:
> Error: Instances of WMenuItem are not indexable
>
>
> 2007/12/29, Rajeev Lochan <[hidden email]>:
> > hi,
> > 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.
> >
> > The error you have got is due to the fact that the method
> > children
> > ^ Array with: menu
> >
> > is not triggered properly.
> >
> > Update if you still encounter any problem,
> > Hope that helps,
> > Rajeev
> >
> >
> >
> > On Dec 29, 2007 5:48 PM, an organic < [hidden email]> wrote:
> >
> > >
> > > 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
> > >
> > > thisContextWARenderContinuation>>componentsNotFound:
> selfa WARenderContinuation aCollectionan Array(a SubMenu)
> > > thisContextWARenderContinuation>>unprocessedCallbacks:
> selfa WARenderContinuation aCollectionan Array(a WAActionCallback)owners an
> Array(a SubMenu) eacha WAActionCallback
> > > thisContextWARenderContinuation>>processCallbacks:
> selfa WARenderContinuation aRequesta WARequest GET /seaside/sitelastPosition
> 0 callbackStreama WACallbackStreameach a WAToolFrame
> > > thisContext[] in WARenderContinuation>>handleRequest:
> {[self processCallbacks: aRequest]} self a WARenderContinuationaRequesta
> WARequest GET /seaside/site rnil
> > > thisContext BlockContext>>on:do: self[] in
> WARenderContinuation>>handleRequest: {[self
> processCallbacks: aRequest]} exception an ExceptionSet handlerAction[] in
> WARenderContinuation>>withNotificationHandler: {[:n | n]}
> handlerActivetrue
> > >
> > > I hope it's quite clear. Thnx for help
> > >
> > > _______________________________________________
> > > seaside mailing list
> > > [hidden email]
> > >
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> > >
> > >
> >
> >
> >
> > --
> > Rajeev Lochan
> >
> > Co-founder, AR-CAD.com
> >
> > http://www.ar-cad.com
> > +91 9243468076 (Bangalore)
> > 080 65355873
> > _______________________________________________
> > seaside mailing list
> > [hidden email]
> >
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> >
> >
>
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside