<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns:st1 = "urn:schemas-microsoft-com:office:smarttags" xmlns:o =
"urn:schemas-microsoft-com:office:office"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.3268" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=484485722-30032008><FONT face="Trebuchet MS"
color=#0000ff size=2>Is not a secret Rob. I have at hand this login
component I've made. I'll comment on the code the most important
methods:</FONT></SPAN></DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2>Login>>createComponents</FONT></SPAN></DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN
class=484485722-30032008> "Creates the subcomponents of the
receiver."</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN
class=484485722-30032008></SPAN></FONT> </DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2> super createComponents.<BR> <BR> self <BR> at:
#username put: (MVPLabeledPresenter
new<BR> label:
'Username';<BR> at: #presenter put:
(MVPTextInputPresenter
new<BR> submitOnEnter:
true;<BR> yourself);<BR> yourself);<BR> at:
#password put: (MVPToolbar new "I use a toobar here just as a layout
convenience"<BR> at:
#input<BR> putTool:
(MVPLabeledPresenter
new<BR> label:
'Password';<BR> at:
#presenter put: (MVPPasswordInputPresenter
new<BR> submitOnEnter:
true;<BR> yourself);<BR> yourself);<BR> at:
#memory<BR> putTool:
(MVPAnchorButton
new<BR> model:
'I forgot my
password/username';<BR> yourself);<BR> yourself);<BR> at:
#signIn put: (MVPSubmitButton new<BR></FONT></SPAN><SPAN
class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2> model: 'Sign
in';<BR> voidCallback; "so it wont
submit"<BR> yourself);<BR> yourself</FONT></SPAN></DIV>
<DIV><SPAN class=484485722-30032008></SPAN><SPAN class=484485722-30032008><FONT
face="Trebuchet MS" color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2>Login>>model: aModel</FONT></SPAN></DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN
class=484485722-30032008> "Sets the model of
the receiver."</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN
class=484485722-30032008></SPAN></FONT> </DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2> super model: aModel.</FONT></SPAN></DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2>"Aspect values are cool because they transparently will get the fresh
value with each render</FONT></SPAN></DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2>or set it if they are submitted." </FONT></SPAN></DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2> self username model: (aModel aspectValue:
#username).<BR> (self password at: #input) model: (aModel aspectValue:
#password).</FONT></SPAN></DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2>Login>>makeLayout</FONT></SPAN></DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2> | keys |</FONT></SPAN></DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2> keys :=
#(<BR> username<BR> password<BR> signIn<BR> )
asOrderedCollection.</FONT></SPAN></DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2>"This creature cames from a kind family of layout
policies</FONT></SPAN></DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2>and they know how to deal with tables so we can't forget about
them"</FONT></SPAN></DIV>
<DIV><SPAN class=484485722-30032008></SPAN><SPAN class=484485722-30032008><FONT
face="Trebuchet MS" color=#0000ff size=2> ^(MVPVerticalFlowLayout
createFor: self)<BR> order:
keys;<BR> yourself</FONT></SPAN></DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2>Login>>wireEvents</FONT></SPAN></DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2> "Makes the wiring of events for the
receiver.</FONT></SPAN></DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2> This events are in fact announcements in the server
(not the ones at DOM).</FONT></SPAN></DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2> This wiring is meant to establish loose coupling
between children and parent presenters"</FONT></SPAN></DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2> super wireEvents.<BR> <BR> self signIn
<BR> subscribe: MVPSubmitButtonPressed send: #onSignInPressed: to:
self;<BR> yourself.<BR> <BR> </FONT></SPAN></DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2>Login>>onSignInPressed: anAnnouncement</FONT></SPAN></DIV>
<DIV><FONT face="Trebuchet MS" size=2></FONT> </DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2> self answer: (self session userOrNilFor: self
model)</FONT></SPAN></DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2>"Here are a couple of methods related to the DOM part of the
login"</FONT></SPAN></DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2> Login>></FONT></SPAN><SPAN class=484485722-30032008><FONT
face="Trebuchet MS" color=#0000ff size=2>installDOMElementBehaviorOn: html
<BR> "Returns the script that installs the methods in the <BR> DOM
Element which is an homologue of the receiver."</FONT></SPAN></DIV>
<DIV><FONT face="Trebuchet MS" size=2></FONT> </DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2> ^(super installDOMElementBehaviorOn: html)<BR> add:
(self elementOn: html) asJQElement curvyCorner;<BR> add: ((self
username presenter focusOn: html) timeout: 100);<BR> add: (self
assign: (self onSignInClickedFunctionOn: html) as: 'onSignInClicked' on:
html);<BR></FONT></SPAN></DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2>"Here I hook a DOM event for the homologue of the receiver and wire it
<FONT face="Trebuchet MS" color=#0000ff size=2><SPAN class=484485722-30032008>to
a custom reaction.</SPAN></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN
class=484485722-30032008>This can be done also with custom events (thanks to
fire introduced in Prototype 1.6.0)"</SPAN></FONT></DIV>
<DIV> </FONT></SPAN></DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2> add: (self signIn<BR> elementOn:
#click<BR> call:
'onSignInClicked'<BR> with:'anEvent'
asSUObject<BR> in: (self elementOn:
html)<BR> on:
html);<BR> yourself</FONT></SPAN></DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2>Login>>onSignInClickedFunctionOn: html</FONT></SPAN></DIV>
<DIV><SPAN class=484485722-30032008> <FONT face="Trebuchet MS"
color=#0000ff size=2>"Returns the function which will render as javascript at
DOM.</FONT></SPAN></DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2> Filters submits with no username so server is not
bothered</FONT></SPAN></DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2> with this kind of spureous
requests."</FONT></SPAN></DIV>
<DIV><SPAN class=484485722-30032008><FONT face="Trebuchet MS" color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=484485722-30032008></SPAN><SPAN class=484485722-30032008><FONT
face="Trebuchet MS" color=#0000ff size=2> ^ SUFunction new argument:
'anEvent';<BR> add: ((((self username presenter formElementOn: html)
value <BR> access: 'length') >
1)<BR> then: (SUForm new id: 'systemForm')
submit<BR> else: (SUScript
new<BR> add: 'anEvent' asSUEvent
stop;<BR> add: (html effect highlight
id: (self username elementOn:
html));<BR> add: (self username
presenter formElementOn: html)
focus;<BR> yourself));<BR> yourself</FONT></SPAN></DIV>
<DIV><FONT face="Trebuchet MS" size=2></FONT> </DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN
class=484485722-30032008>I hope you get the idea,</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN
class=484485722-30032008></SPAN></FONT> </DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN
class=484485722-30032008> cheers,</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN
class=484485722-30032008></SPAN></FONT> </DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN
class=484485722-30032008>Sebastian</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2></FONT> </DIV>
<DIV><BR></DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=es dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>De:</B> seaside-bounces@lists.squeakfoundation.org
[mailto:seaside-bounces@lists.squeakfoundation.org] <B>En nombre de </B>Rob
Rothwell<BR><B>Enviado el:</B> Domingo, 30 de Marzo de 2008
17:05<BR><B>Para:</B> Seaside - general discussion<BR><B>Asunto:</B> Re:
[Seaside] Seaside vs. Aida<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=gmail_quote>On Sun, Mar 30, 2008 at 3:52 PM, Sebastian Sastre
<<A href="mailto:ssastre@seaswork.com">ssastre@seaswork.com</A>>
wrote:<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
nice clarification. I think I discovered my framework uses
Seaside as platform to be able to make something conceptually very similar
to what you described. Anyway my code would look more similar to a esktop
development.</BLOCKQUOTE>
<DIV><BR class=webkit-block-placeholder></DIV>
<DIV>Can you give me an example of your code (kind of like Janko just did)?
What are you developing (unless it's a secret!)? Have you built an
additional layer on top of Seaside?</DIV>
<DIV><BR class=webkit-block-placeholder></DIV>
<DIV>Rob </DIV></DIV></BLOCKQUOTE></BODY></HTML>