[Arp] Dispatch event or internal ?
Davies, Grant M.
Grant.Davies at nscorp.com
Thu May 26 08:50:47 PDT 2005
Hi guys, have a fairly simple design question but wanted to see the best way
of implementing this using ARP.
I have a loginForm that has a id, password and button, I catch the id -
changed event and the password changed event so that the login button is
grayed out when those fields are not valid, I have strict validation that
the id must be 5 characters or more (RACF security) and the password must be
exactly 8 characters.
What I was wondering is should I keep to booleans in my LoginFrom class
var idValid:Boolean;
var passwordValid:Boolean;
and when catch the change event for id set the idValid property to true or
false and then call another method called "updateLoginButton" that says
something like
if (idValid == true && passwordValid == true)
loginButton.enabeled = true;
else
loginButton.enabled = false;
or....
when the idValid or passwordValid fields are changed I fire a new event like
dispatchEvent( {type:"idStateChanged"});
and have my LoginForm register as a listener to its own "system" event and
then have it update the login button after receiving a "idStateChanged"
event ?
It seems to me that this should all be handled inside the LoginForm and not
be published as a system event but I wanted to confirm this before moving
forward as I'm new to the ARP framework.
Grant
More information about the Arp
mailing list