the null object thing seems simpler than my idea, thank you!<br><br><div class="gmail_quote">On Fri, Apr 25, 2008 at 8:41 PM, David Zmick <<a href="mailto:dz0004455@gmail.com">dz0004455@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
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<div><div></div><div class="Wj3C7c"><br><br><div class="gmail_quote">On Fri, Apr 25, 2008 at 6:24 PM, Ramon Leon <<a href="mailto:ramon.leon@allresnet.com" target="_blank">ramon.leon@allresnet.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>><br>
> wow, this shouldn't be that hard to figure out, but, I can't<br>
> seem to be able to change the value of wantsLogin( the<br>
> variable I am using, should be self explanatory) from my<br>
> prototype menu component, so, I can't get to the login<br>
> component, what am i doing?<br>
><br>
> MenuComponent>>renderConentOn: html<br>
> html anchor callback: [self session wantsLogin: true];<br>
> with: [html text: 'login']<br>
><br>
> RootTask>>go<br>
> [ self session wantsLogin ]<br>
> whileTrue: [Transcript show: 'wantsLogin = true'; cr.<br>
> self call: self loginComponent].<br>
> Transcript show: 'wantsLogin = false'; cr. self call:<br>
> self menuComponent<br>
><br>
<br>
</div>Your logic seems a bit backwards here. By the time your menu component is<br>
shown and has the chance to modify wantsLogin, you're past the login. To<br>
make it work, you need to restart the task by answering from the menu.<br>
<br>
html anchor callback: [self session wantsLogin: true. self answer]; with:<br>
'login'<br>
<br>
So the menu component returns control of the UI back to the Task, which will<br>
then restart. If you're going to force a login, probably better to stick<br>
the user on the session and have the task check for a nil user instead, then<br>
the login form need just set a current user on the session.<br>
<br>
I usually use a null object pattern here and have a special null user so I<br>
can delegate to the current user (whether logged in or out) to find out what<br>
actions are available. For example, login is a valid action for a null user<br>
while logout is a valid action for any other user.<br>
<font color="#888888"><br>
Ramon Leon<br>
<a href="http://onsmalltalk.com" target="_blank">http://onsmalltalk.com</a><br>
</font><div><div></div><div><br>
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</div></div></blockquote></div><br><br clear="all"><br></div></div><div><div></div><div class="Wj3C7c">-- <br>David Zmick<br>/dz0004455\<br><a href="http://dz0004455.googlepages.com" target="_blank">http://dz0004455.googlepages.com</a><br>
<a href="http://dz0004455.blogspot.com" target="_blank">http://dz0004455.blogspot.com</a>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>David Zmick<br>/dz0004455\<br><a href="http://dz0004455.googlepages.com">http://dz0004455.googlepages.com</a><br><a href="http://dz0004455.blogspot.com">http://dz0004455.blogspot.com</a>