Hello, 

I have done this in a seaside tutorial but whatever I try I do not see the menu 
appearing.

Can someone help me figure out what I have done.

I include a fileout because I cannot get it working with a github repo.
WAComponent subclass: #StListComponent
        instanceVariableNames: ''
        classVariableNames: ''
        package: 'STTutTodoApp'!

!StListComponent methodsFor: 'rendering' stamp: 'RoelofWobben 9/25/2021 19:47'!
renderContentOn: html
 

 
html table: [
 
 
html
 
 
 
tableRow: [
 
 
 
 
html tableData: [html text: 'Table entry']];
 
 
 
tableRow: [
 
 
 
 
html tableData: [html text: 'Table entry']]].! !


WAComponent subclass: #StMenuComponent
        instanceVariableNames: 'entries'
        classVariableNames: ''
        package: 'STTutTodoApp'!

!StMenuComponent methodsFor: 'adding' stamp: 'RoelofWobben 9/25/2021 19:53'!
addEntry: aString withAction: aBlock

 
^ self entries add: aString -> aBlock! !


!StMenuComponent methodsFor: 'rendering' stamp: 'RoelofWobben 9/25/2021 19:50'!
renderContentOn: html

 
self entries
 
 
do: [:entry |
 
 
 
html anchor
 
 
 
 
callback: entry value;
 
 
 
 
with: entry key]
 
 
separatedBy: [html space].! !


!StMenuComponent methodsFor: 'initialization' stamp: 'RoelofWobben 9/25/2021 
19:55'!
initialize 

 super initialize.
 entries := OrderedCollection new.
! !


!StMenuComponent methodsFor: 'accessing' stamp: 'RoelofWobben 9/25/2021 19:50'!
entries

        ^ entries! !

!StMenuComponent methodsFor: 'accessing' stamp: 'RoelofWobben 9/25/2021 19:50'!
entries: anObject

        entries := anObject! !


WAComponent subclass: #StRootComponent
        instanceVariableNames: 'menuComponent listComponent'
        classVariableNames: ''
        package: 'STTutTodoApp'!

!StRootComponent methodsFor: 'rendering' stamp: 'RoelofWobben 9/25/2021 19:45'!
renderContentOn: html

 
html heading: 'ToDo-List'.
 
html div
 
 
class: 'menu';
 
 
with: self menuComponent.
 
html div
 
 
class: 'list';
 
 
with: self listComponent.! !

!StRootComponent methodsFor: 'rendering' stamp: 'RoelofWobben 9/25/2021 19:51'!
initializeMenuComponent

 
self menuComponent: (StMenuComponent new
 
 
addEntry: 'All' withAction: [];
 
 
addEntry: 'Completed' withAction: [];
 
 
addEntry: 'Pending' withAction: [];
 
 
addEntry: 'Missed' withAction: [];
 
 
yourself).! !


!StRootComponent methodsFor: 'accessing' stamp: 'RoelofWobben 9/25/2021 19:46'!
listComponent

        ^ listComponent! !

!StRootComponent methodsFor: 'accessing' stamp: 'RoelofWobben 9/25/2021 19:46'!
listComponent: anObject

        listComponent := anObject! !

!StRootComponent methodsFor: 'accessing' stamp: 'RoelofWobben 9/25/2021 19:46'!
menuComponent

        ^ menuComponent! !

!StRootComponent methodsFor: 'accessing' stamp: 'RoelofWobben 9/25/2021 19:48'!
children 

^ Array with: self menuComponent with: self listComponent! !

!StRootComponent methodsFor: 'accessing' stamp: 'RoelofWobben 9/25/2021 19:59'!
initialize 

 super initialize.
  self menuComponent: StMenuComponent new; 
  listComponent: StListComponent new.
! !

"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!

StRootComponent class
        instanceVariableNames: ''!

!StRootComponent class methodsFor: 'testing' stamp: 'RoelofWobben 9/25/2021 
12:28'!
canBeRoot

 
^true! !


Object subclass: #StTask
        instanceVariableNames: 'completed deadline taskDescription id taskName'
        classVariableNames: ''
        package: 'STTutTodoApp'!

!StTask methodsFor: 'accessing' stamp: 'RoelofWobben 9/25/2021 18:20'!
deadline

        ^ deadline! !

!StTask methodsFor: 'accessing' stamp: 'RoelofWobben 9/25/2021 18:20'!
deadline: anObject

        deadline := anObject! !

!StTask methodsFor: 'accessing' stamp: 'RoelofWobben 9/25/2021 18:20'!
taskName

        ^ taskName! !

!StTask methodsFor: 'accessing' stamp: 'RoelofWobben 9/25/2021 18:20'!
taskDescription: anObject

        taskDescription := anObject! !

!StTask methodsFor: 'accessing' stamp: 'RoelofWobben 9/25/2021 18:20'!
taskName: anObject

        taskName := anObject! !

!StTask methodsFor: 'accessing' stamp: 'RoelofWobben 9/25/2021 18:20'!
id

        ^ id! !

!StTask methodsFor: 'accessing' stamp: 'RoelofWobben 9/25/2021 18:20'!
completed: anObject

        completed := anObject! !

!StTask methodsFor: 'accessing' stamp: 'RoelofWobben 9/25/2021 18:20'!
taskDescription

        ^ taskDescription! !

!StTask methodsFor: 'accessing' stamp: 'RoelofWobben 9/25/2021 18:20'!
completed

        ^ completed! !

!StTask methodsFor: 'accessing' stamp: 'RoelofWobben 9/25/2021 18:20'!
id: anObject

        id := anObject! !


!StTask methodsFor: 'testing' stamp: 'RoelofWobben 9/25/2021 18:22'!
hasBeenMissed

 
^ self completed not and: [self deadline < Date today]! !

!StTask methodsFor: 'testing' stamp: 'RoelofWobben 9/25/2021 18:22'!
initialize

 
self
 
 
deadline: Date tomorrow;
 
 
completed: false.! !

!StTask methodsFor: 'testing' stamp: 'RoelofWobben 9/25/2021 18:21'!
isPending

 
^ self completed not and: [self deadline >= Date today]! !


Object subclass: #StUser
        instanceVariableNames: 'id userName email tasks password'
        classVariableNames: ''
        package: 'STTutTodoApp'!

!StUser methodsFor: 'initialization' stamp: 'RoelofWobben 9/25/2021 18:18'!
initialize
 

 
self tasks: OrderedCollection new.! !


!StUser methodsFor: 'accessing' stamp: 'RoelofWobben 9/25/2021 18:18'!
tasks: anObject

        tasks := anObject! !

!StUser methodsFor: 'accessing' stamp: 'RoelofWobben 9/25/2021 18:18'!
email: anObject

        email := anObject! !

!StUser methodsFor: 'accessing' stamp: 'RoelofWobben 9/25/2021 18:18'!
userName

        ^ userName! !

!StUser methodsFor: 'accessing' stamp: 'RoelofWobben 9/25/2021 18:18'!
email

        ^ email! !

!StUser methodsFor: 'accessing' stamp: 'RoelofWobben 9/25/2021 18:18'!
tasks

        ^ tasks! !

!StUser methodsFor: 'accessing' stamp: 'RoelofWobben 9/25/2021 18:18'!
userName: anObject

        userName := anObject! !

!StUser methodsFor: 'accessing' stamp: 'RoelofWobben 9/25/2021 18:18'!
id

        ^ id! !

!StUser methodsFor: 'accessing' stamp: 'RoelofWobben 9/25/2021 18:18'!
password: anObject

        password := anObject! !

!StUser methodsFor: 'accessing' stamp: 'RoelofWobben 9/25/2021 18:18'!
password

        ^ password! !

!StUser methodsFor: 'accessing' stamp: 'RoelofWobben 9/25/2021 18:18'!
id: anObject

        id := anObject! !


!StUser methodsFor: 'adding' stamp: 'RoelofWobben 9/25/2021 18:19'!
addTask: aTask
 

 
^ self tasks add: aTask! !

Reply via email to