[Seaside] [NEWBIES] How to set up a multi-page website
dz0004455 at gmail.com
Sat Apr 26 02:42:35 UTC 2008
the null object thing seems simpler than my idea, thank you!
On Fri, Apr 25, 2008 at 8:41 PM, David Zmick <dz0004455 at gmail.com> wrote:
> The login isn't a requirement to get on the page, so I want to have a link,
> but, I understand what you are saying
> On Fri, Apr 25, 2008 at 6:24 PM, Ramon Leon <ramon.leon at allresnet.com>
>> > wow, this shouldn't be that hard to figure out, but, I can't
>> > seem to be able to change the value of wantsLogin( the
>> > variable I am using, should be self explanatory) from my
>> > prototype menu component, so, I can't get to the login
>> > component, what am i doing?
>> > MenuComponent>>renderConentOn: html
>> > html anchor callback: [self session wantsLogin: true];
>> > with: [html text: 'login']
>> > RootTask>>go
>> > [ self session wantsLogin ]
>> > whileTrue: [Transcript show: 'wantsLogin = true'; cr.
>> > self call: self loginComponent].
>> > Transcript show: 'wantsLogin = false'; cr. self call:
>> > self menuComponent
>> Your logic seems a bit backwards here. By the time your menu component is
>> shown and has the chance to modify wantsLogin, you're past the login. To
>> make it work, you need to restart the task by answering from the menu.
>> html anchor callback: [self session wantsLogin: true. self answer]; with:
>> So the menu component returns control of the UI back to the Task, which
>> then restart. If you're going to force a login, probably better to stick
>> the user on the session and have the task check for a nil user instead,
>> the login form need just set a current user on the session.
>> I usually use a null object pattern here and have a special null user so I
>> can delegate to the current user (whether logged in or out) to find out
>> actions are available. For example, login is a valid action for a null
>> while logout is a valid action for any other user.
>> Ramon Leon
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
> David Zmick
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the seaside