[Seaside] Seaside vs. Aida
ssastre at seaswork.com
Mon Mar 31 00:15:02 UTC 2008
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:
"Creates the subcomponents of the receiver."
at: #username put: (MVPLabeledPresenter new
at: #presenter put: (MVPTextInputPresenter new
at: #password put: (MVPToolbar new "I use a toobar here just as a layout
putTool: (MVPLabeledPresenter new
at: #presenter put: (MVPPasswordInputPresenter new
putTool: (MVPAnchorButton new
model: 'I forgot my password/username';
at: #signIn put: (MVPSubmitButton new
model: 'Sign in';
voidCallback; "so it wont submit"
"Sets the model of the receiver."
super model: aModel.
"Aspect values are cool because they transparently will get the fresh value with
or set it if they are submitted."
self username model: (aModel aspectValue: #username).
(self password at: #input) model: (aModel aspectValue: #password).
| keys |
keys := #(
"This creature cames from a kind family of layout policies
and they know how to deal with tables so we can't forget about them"
^(MVPVerticalFlowLayout createFor: self)
"Makes the wiring of events for the receiver.
This events are in fact announcements in the server (not the ones at DOM).
This wiring is meant to establish loose coupling between children and parent
subscribe: MVPSubmitButtonPressed send: #onSignInPressed: to: self;
self answer: (self session userOrNilFor: self model)
"Here are a couple of methods related to the DOM part of the login"
"Returns the script that installs the methods in the
DOM Element which is an homologue of the receiver."
^(super installDOMElementBehaviorOn: html)
add: (self elementOn: html) asJQElement curvyCorner;
add: ((self username presenter focusOn: html) timeout: 100);
add: (self assign: (self onSignInClickedFunctionOn: html) as:
'onSignInClicked' on: html);
"Here I hook a DOM event for the homologue of the receiver and wire it to a
This can be done also with custom events (thanks to fire introduced in Prototype
add: (self signIn
in: (self elementOn: html)
Filters submits with no username so server is not bothered
with this kind of spureous requests."
^ SUFunction new argument: 'anEvent';
add: ((((self username presenter formElementOn: html) value
access: 'length') > 1)
then: (SUForm new id: 'systemForm') submit
else: (SUScript new
add: 'anEvent' asSUEvent stop;
add: (html effect highlight id: (self username elementOn: html));
add: (self username presenter formElementOn: html) focus;
I hope you get the idea,
De: seaside-bounces at lists.squeakfoundation.org
[mailto:seaside-bounces at lists.squeakfoundation.org] En nombre de Rob Rothwell
Enviado el: Domingo, 30 de Marzo de 2008 17:05
Para: Seaside - general discussion
Asunto: Re: [Seaside] Seaside vs. Aida
On Sun, Mar 30, 2008 at 3:52 PM, Sebastian Sastre <ssastre at seaswork.com> wrote:
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.
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?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the seaside