[Seaside] [NEWBIES] How to set up a multi-page website

David Zmick 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>
> wrote:
>
>> >
>> > 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:
>> 'login'
>>
>> So the menu component returns control of the UI back to the Task, which
>> will
>> 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,
>> then
>> 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
>> what
>> actions are available.  For example, login is a valid action for a null
>> user
>> while logout is a valid action for any other user.
>>
>> Ramon Leon
>> http://onsmalltalk.com
>>
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>
>
>
> --
> David Zmick
> /dz0004455\
> http://dz0004455.googlepages.com
> http://dz0004455.blogspot.com
>



-- 
David Zmick
/dz0004455\
http://dz0004455.googlepages.com
http://dz0004455.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20080425/f81448ca/attachment.htm


More information about the seaside mailing list