[Seaside] Problems using Tasks and MenuDemo

William Hubbard billhubard at gmail.com
Fri Feb 1 17:41:37 UTC 2008


I'm running into problems trying to use the MenuDemo (
http://blog.leugim.com.mx/index.php/2008/01/03/seaside-menus/) approach and
Tasks. Take a look the following scenario:

I'm using a MainComponent (like MDMain in the tutorial), and this holds a
task instance variable to the MainTask and a content iVar for the menu item
components (initialized with a "null" component, WAComponent) . In the go
method I have:

self loginUser ifTrue: [
    self isolate: [
        result := self call: WelcomeComponent new
        (more calls here)
    ]
]

Therefore my UI is like this:

    LoginComponent
        |
        |
        true
        |

The user is ok, then shows the Menu from MainComponent (the menu is rendered
only if the user is authenticated) and the WelcomeComponent from the task.
(content still would be just WAComponent like the tutorial)

|          |
|          |
| Menu |  WelcomeComponent
|          |

When I click a menu item, content needs to be replaced with the
NewComponentFromMenu, but the WelcomeComponent is still there, displayed
below the NewComponentFromMenu:


|          |
|          |
| Menu |  NewComponentFromMenu
|          |
|          |
|          |
|          |  WelcomeComponent
|          |

I understand this happens because the MenuDemo do not use call: message, but
I don't know how to "replace" the WelcomeComponent with the
NewComponentFromMenu when a menu item is clicked. I tried setting the
content iVar to the WelcomeComponent when enters the isolate: but this just
shows two times the WelcomeComponent:

|          |
|          |
| Menu |  WelcomeComponent
|          |
|          |
|          |
|          |  WelcomeComponent
|          |


Any idea how to solve this?
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20080201/fee22530/attachment-0001.htm


More information about the seaside mailing list