Using Magritte Reports in Seaside

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

Using Magritte Reports in Seaside

Sau Sheong
(Sorry forgot the subject)

Hi

I was playing around with the Magritte exercises and was going through the Magritte solutions. I was trying to use Magritte Reports and I hit some problems in Exercise 14 (adding a column to the report). I didn't exactly follow the exercises as I instantiated the report object on first call instead of doing it on initialization. This is my code:

UserComponent>>report
^ report
ifNil: [report := MAReport
rows: self class users
description: (User description
select: [:each | #(#userName #firstName #lastName ) includes: each accessor selector]).
report addColumn: (MACommandColumn new addCommandOn: self selector: #view:;
yourself)]


However I get this error:

MessageNotUnderstood: MACommandColumn>>decorationChainDo:

    * MACommandColumn(Object)>>doesNotUnderstand: #decorationChainDo:

          self a MACommandColumn
          temps
          aMessage decorationChainDo: [] in UserComponent(WAPresenter)>>withNextPresentersDo: {[:ea | ea withNextPresen...etc...
          inst vars
          report a MAReport
          properties a Dictionary()
          commands an OrderedCollection(MessageSend(#view: -> an UserComponent)->'View')

    * [] in UserComponent(WAComponent)>>nextPresentersDo: {[:ea | ea decorationChainDo: aBlock]}

          self an UserComponent
          temps
          aBlock [] in UserComponent(WAPresenter)>>withNextPresentersDo: {[:ea | ea withNextPresentersDo: aBlock]}
          ea a MACommandColumn
          inst vars
          decoration a WAStateHolder(a WAAnswerHandler)
          report a MAReport

    * [] in UserComponent(WAComponent)>>childrenDo: {[:ea | ea ifNotNil: [aBlock value: ea]]}

          self an UserComponent
          temps
          aBlock [] in UserComponent(WAComponent)>>nextPresentersDo: {[:ea | ea decorationChainDo: aBlock]}
          ea a MACommandColumn
          inst vars
          decoration a WAStateHolder(a WAAnswerHandler)
          report a MAReport

    * OrderedCollection>>do:

          self an OrderedCollection(a MACommandColumn)
          temps
          aBlock [] in UserComponent(WAComponent)>>childrenDo: {[:ea | ea ifNotNil: [aBlock value: ea]]}
          index 3
          inst vars
          array an Array(nil nil a MACommandColumn nil nil nil nil nil nil nil)
          firstIndex 3
          lastIndex 3

    * UserComponent(WAComponent)>>childrenDo:

          self an UserComponent
          temps
          aBlock [] in UserComponent(WAComponent)>>nextPresentersDo: {[:ea | ea decorationChainDo: aBlock]}
          ea a MACommandColumn
          inst vars
          decoration a WAStateHolder(a WAAnswerHandler)
          report a MAReport


Any help please? Thanks!


Sau Sheong



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

Re: Using Magritte Reports in Seaside

Lukas Renggli
> UserComponent>>report
>  ^ report
>  ifNil: [report := MAReport
>  rows: self class users
>  description: (User description
>  select: [:each | #(#userName #firstName #lastName ) includes: each accessor
> selector]).
>  report addColumn: (MACommandColumn new addCommandOn: self selector: #view:;
>  yourself)]

You should close the bracket on the last line before the #yourself, not after.

Cheers,
Lukas

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

Re: Using Magritte Reports in Seaside

Sau Sheong
Ouch! Thanks for your help, it is working now.

Sau Sheong


On 25 Apr 2007, at 1:16 PM, Lukas Renggli wrote:

>> UserComponent>>report
>>  ^ report
>>  ifNil: [report := MAReport
>>  rows: self class users
>>  description: (User description
>>  select: [:each | #(#userName #firstName #lastName ) includes:  
>> each accessor
>> selector]).
>>  report addColumn: (MACommandColumn new addCommandOn: self  
>> selector: #view:;
>>  yourself)]
>
> You should close the bracket on the last line before the #yourself,  
> not after.
>
> Cheers,
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
> _______________________________________________
> 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