Re: [flexcoders] Re: Cairngorm... Where should this go?

2006-09-09 Thread Douglas Knudsen



ouch, I cried for 10 minutes!  ha!  Its all good.  Tim's suggestion about .errorString agrees with me.DKOn 9/9/06, bjorn.schultheiss <
[EMAIL PROTECTED]> wrote:Sorry, bad morning.I do have manners, i just didn't show them very well then.
Regards,Bjorn Schultheiss--Flexcoders Mailing ListFAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/<*> Your email settings:Individual Email | Traditional<*> To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join(Yahoo! ID required)<*> To change settings via email:mailto:
[EMAIL PROTECTED]mailto:[EMAIL PROTECTED]<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]<*> Your use of Yahoo! Groups is subject to:http://docs.yahoo.com/info/terms/
-- Douglas Knudsenhttp://www.cubicleman.comthis is my signature, like it?

__._,_.___





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








   






  
  
SPONSORED LINKS
  
  
  

Software development tool
  
  
Software development
  
  
Software development services
  
  


Home design software
  
  
Software development company
  

   
  






  
  Your email settings: Individual Email|Traditional 
  Change settings via the Web (Yahoo! ID required) 
  Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured 
   
Visit Your Group 
   |
  
Yahoo! Groups Terms of Use
   |
  
   Unsubscribe 
   
 

  




__,_._,___



Re: [flexcoders] Re: Cairngorm... Where should this go?

2006-09-09 Thread Ralf Bokelberg
I'd create a model for my input component, which also contains the
errorstring and bind the ui component to it.

Cheers,
Ralf.

On 9/9/06, Tim Hoff <[EMAIL PROTECTED]> wrote:
> Not really so stupid. The default way would be to set the
> errorString of the control:
>
> myTextInput.errorString = "Enter something here dummy!";
>
> This will automatically add the red border and display the red error
> message when the cursor is over the control. To remove the border
> and the message, simply clear the errorString.
>
> myTextInput.errorString = "";
>
> Bjorn, why so harsh? We all have to start somewhere.
>
> -TH
> --- In flexcoders@yahoogroups.com, "bjorn.schultheiss"
> <[EMAIL PROTECTED]> wrote:
> >
> > You are correct,
> >
> > It is a bit of a stupid question.
> >
> > TextField.setStyle('borderColor', 0xFF);
> >
> > TextField.setStyle('borderThickness', 2);
> >
> > Alert.show('FIX THIS FORM');
> >
> > TextField.toolTip
> >
> > There are a heap of different ways
> >
> > Personal Implementation
> >
> > --- In flexcoders@yahoogroups.com, "Douglas Knudsen"
> >  wrote:
> > >
> > > ok, stupid question, this is a great example, but how do you get
> this to
> > > utilise all those fancy vaildation messages in the Flex SDK.  I'm
> > talking
> > > about the ones that change the control to red borders and the
> > fly-out error
> > > message.
> > >
> > > DK
> > >
> > > On 9/8/06, grahampengelly  wrote:
> > > >
> > > > Hi Bjorn
> > > >
> > > > Thanks for taking the time to throw some code into the
> discussion. The
> > > > solution I ended up implementing was similar to the one you
> > suggest. In my
> > > > case the validation was simple, the user either supplies a
> number
> > of answers
> > > > to a question that is between the minimum and maximum allowed
> or
> > they don't.
> > > > My point here is that the validation message to the user is
> more
> > or less
> > > > predefined.
> > > >
> > > > In a more complicated scenario, say a name and address form,
> it would
> > > > appear the model would get messy. Just the name field might
> have
> > required,
> > > > min  max length and [a-z][A-Z] validation rules. Which of these
> > rules is
> > > > broken and on what field would need to be passed back to the
> view
> > if you
> > > > say, wanted to display an instruction to the user or color the
> > appropriate
> > > > textfield. Having engaged in this discussion I think I have now
> > come to a
> > > > solution for scenarios like this that would maintain the
> intent of
> > the MVC
> > > > pattern.
> > > >
> > > > On the model you would maintain a collection of objects such
> as this:
> > > >
> > > > public class ValidationFailedInfo
> > > > {
> > > > private var _propertyName:String;
> > > > private var _message:String;
> > > >
> > > > public function get propertyName():String
> > > > {
> > > > return _propertyName;
> > > > }
> > > >
> > > > public function get message():String
> > > > {
> > > > return _message;
> > > > }
> > > >
> > > > public function ValidationFailedInfo(message:String,
> > > > propertyName:String)
> > > > {
> > > > _message = message;
> > > > _propertyName = propertyName;
> > > > }
> > > > }
> > > >
> > > > That would be populated/cleared by a validate() function (not
> > shown but it
> > > > just applies your rules to the properties of the model). You
> would
> > also have
> > > > a method such as:
> > > >
> > > > public function
> > GetValidationMessages(propertyName:String):Array
> > > > {
> > > > validate();
> > > > var  messageArr:Array = new Array();
> > > > var currValInfo:ValidationFailedInfo = null;
> > > > for(var x:int = 0; x<_validationInfoList.length;
> x++)
> > > > {
> > > > curValInfo =
> > ValidationFailedInfo(_validationInfoList[x]);
> > > > if(currValInfo.propertyName == propertyName)
> > > > {
> > > > messageArr.push(currValInfo.message);
> > > > }
> > > > }
> > > > return messageArr;
> > > > }
> > > >
> > > > You could use this to determine whether each field is valid
> and if
> > not why
> > > > not. All of the validation rules would remain in the model as
> > would the
> > > > message strings that you return. If for example your
> application
> > supports 10
> > > > languages, storing all of the language logic in the view would
> be a
> > > > maintenance nightmare wheras this would allow all of that to
> stay
> > in the
> > > > model.
> > > >
> > > > Thanks for all of your contributions. Can I also take the
> > opportunity to
> > > > say that this is the most welcoming and active group that I
> have
> > > > participated in... Keep it up [image: :D]
> > > >
> > > > Graham
> > > >
> > > > --- In flexcoders@yahoogroups.com, "Bjorn Schulthe

Re: [flexcoders] Re: Cairngorm... Where should this go?

2006-09-08 Thread Douglas Knudsen



ok, stupid question, this is a great example, but how do you get this to utilise all those fancy vaildation messages in the Flex SDK.  I'm talking about the ones that change the control to red borders and the fly-out error message.
DKOn 9/8/06, grahampengelly <[EMAIL PROTECTED]> wrote:



Hi BjornThanks for taking the time to throw some code into the discussion. The solution I ended up implementing was similar to the one you suggest. In my case the validation was simple, the user either supplies a number of answers to a question that is between the minimum and maximum allowed or they don't. My point here is that the validation message to the user is more or less predefined.
In a more complicated scenario, say a name and address form, it would appear the model would get messy. Just the name field might have required, min  max length and [a-z][A-Z] validation rules. Which of these rules is broken and on what field would need to be passed back to the view if you say, wanted to display an instruction to the user or color the appropriate textfield. Having engaged in this discussion I think I have now come to a solution for scenarios like this that would maintain the intent of the MVC pattern.
On the model you would maintain a collection of objects such as this:    public class ValidationFailedInfo    {        private var _propertyName:String;        private var _message:String;        
        public function get propertyName():String        {            return _propertyName;        }                public function get message():String        {            return _message;
        }                public function ValidationFailedInfo(message:String, propertyName:String)        {            _message = message;            _propertyName = propertyName;        }    }
That would be populated/cleared by a validate() function (not shown but it just applies your rules to the properties of the model). You would also have a method such as:        public function GetValidationMessages(propertyName:String):Array
    {    validate();    var  messageArr:Array = new Array();    var currValInfo:ValidationFailedInfo = null;    for(var x:int = 0; x<_validationInfoList.length; x++)
    {       curValInfo = ValidationFailedInfo(_validationInfoList[x]);    if(currValInfo.propertyName == propertyName)    {    messageArr.push
(currValInfo.message);    }    }    return messageArr;    }You could use this to determine whether each field is valid and if not why not. All of the validation rules would remain in the model as would the message strings that you return. If for example your application supports 10 languages, storing all of the language logic in the view would be a maintenance nightmare wheras this would allow all of that to stay in the model.
Thanks for all of your contributions. Can I also take the opportunity to say that this is the most welcoming and active group that I have participated in... Keep it up 
Graham--- In flexcoders@yahoogroups.com, "Bjorn Schultheiss" <
[EMAIL PROTECTED]> wrote:>> Gladly,>  > simple example.>  > // view> >  
> // model data Object> public function set username(value:String):void> {> _username = value;> validateForm()> }>  > private function validateForm():void
> {> if (_username != undefined)> formValidated = true;> }>  > This is code i've just typed, but the principle remains the same.> Data drives the view via dataBinding. There are alternatives to the way you
> would structure your models and views but the principle remains the same.>  >  > Regards,>  > Bjorn Schultheiss> Senior Flash Developer> QDC Technologies>  
> >   _  > > From: flexcoders@yahoogroups.com [mailto:
flexcoders@yahoogroups.com] On> Behalf Of grahampengelly> Sent: Friday, 8 September 2006 12:24 PM> To: 
flexcoders@yahoogroups.com> Subject: [flexcoders] Re: Cairngorm... Where should this go?> > > > Thanks all for the discussion...> > So it seems the consensus is the validation, from a pattern purist point of
> view should sit in the model. Someone suggested a model.isDataValid> property... This gives us an indication but how should we be communicating> back to the view which data it is that is invalid and what is it that is
> invalid about it? Should the model dispatch a data invalid event that the> view acts upon or a checkValid function that returns the data required to> act?> > I know this is very much academic, particularly as since posting originally,
> I have implemented my validation that works perfectly well. I would be> interested to hear Bjorn how you get your validation information back out of> the model to display it in the view.> 
> Cheers...> > Graham> Blog   
> > --- In flexcoders@yahoogroups.com, "Bjorn Schultheiss"
> bjorn.schultheiss@ wrote:> >> > I'm going to fly kick this thread quickly.> > Validation relates to model, qu

RE: [flexcoders] Re: Cairngorm... Where should this go?

2006-09-07 Thread Bjorn Schultheiss





Gladly,
 
simple example.
 
// view

 
// model data Object
public function set 
username(value:String):void
{
    _username = value;
    validateForm()
}
 
private function validateForm():void
{
    if (_username != 
undefined)
    formValidated = true;
}
 
This is code i've just typed, but the principle remains the 
same.
Data drives the view via dataBinding. There are 
alternatives to the way you would structure your models and views but the 
principle remains the same.
 
 
Regards,
 
Bjorn 
Schultheiss
Senior Flash 
Developer
QDC 
Technologies
 


From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On Behalf Of 
grahampengellySent: Friday, 8 September 2006 12:24 
PMTo: flexcoders@yahoogroups.comSubject: [flexcoders] Re: 
Cairngorm... Where should this go?


Thanks all for the discussion...So it seems the consensus is the 
validation, from a pattern purist point of view should sit in the model. Someone 
suggested a model.isDataValid property... This gives us an indication but how 
should we be communicating back to the view which data it is that is invalid and 
what is it that is invalid about it? Should the model dispatch a data invalid 
event that the view acts upon or a checkValid function that returns the data 
required to act?I know this is very much academic, particularly as since 
posting originally, I have implemented my validation that works perfectly well. 
I would be interested to hear Bjorn how you get your validation information back 
out of the model to display it in the view.Cheers...GrahamBlog --- In 
[EMAIL PROTECTED]ups.com, "Bjorn Schultheiss" 
...> wrote:>> I'm going to fly kick 
this thread quickly.> Validation relates to model, quite simply.> 
> > Regards,> > Bjorn Schultheiss> Senior 
Flash Developer> QDC Technologies> > > _ 
> > From: [EMAIL PROTECTED]ups.com 
[mailto:flexcoders@yahoogroups.com] On> Behalf Of 
lostinrecursion> Sent: Friday, 8 September 2006 6:28 AM> To: 
[EMAIL PROTECTED]ups.com> Subject: [flexcoders] Re: Cairngorm... 
Where should this go?> > > > Sorry but I have to 
interject on this. Intsrestingly enough I asked a> similar question some 
days ago and did not receive a response from a> design pettern 
perspective, but from a "what works" perspective. I am> actually 85% of 
the tim all about what works, so not there is anything> wrong with it. 
But, I would like to hear some other rhoughts on it> since Validation is 
integral to just about every RIA that accepts data> on the 
planet.> > In MVC, the Validators seem to be more of a middle 
ground issue. Since> the Model contains the business logic and is fed 
data to process and> the controller merely acts as waystation back and 
forth from view to> model, it would seem to me that there should almost 
be another letter> in MVC since validation doesn't really fit 
anywhere.> > However, it would seem to me that a Validation 
function would be> placed in the model itself. Since the view should only 
query the model> to get its current state and accept the user input, it 
seems it should> not be in the View to promote modularity. 
{myModel.dataIsValid == true}> > Because what if you wanted 
to add another View to the application??> (As the OP mentioned) 
Seems to me like it would be malformed in the View.> > H... 
Perhaps MVCV - ;)>
__._,_.___





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








   






  
  
SPONSORED LINKS
  
  
  

Software development tool
  
  
Software development
  
  
Software development services
  
  


Home design software
  
  
Software development company
  

   
  






  
  Your email settings: Individual Email|Traditional 
  Change settings via the Web (Yahoo! ID required) 
  Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured 
   
Visit Your Group 
   |
  
Yahoo! Groups Terms of Use
   |
  
   Unsubscribe 
   
 

  




__,_._,___



RE: [flexcoders] Re: Cairngorm... Where should this go?

2006-09-07 Thread Bjorn Schultheiss





I'm going to fly kick this thread 
quickly.
Validation relates to model, quite 
simply.
 
 
Regards,
 
Bjorn 
Schultheiss
Senior Flash 
Developer
QDC 
Technologies
 


From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On Behalf Of 
lostinrecursionSent: Friday, 8 September 2006 6:28 
AMTo: flexcoders@yahoogroups.comSubject: [flexcoders] Re: 
Cairngorm... Where should this go?


Sorry but I have to interject on this. Intsrestingly enough I asked 
asimilar question some days ago and did not receive a response from 
adesign pettern perspective, but from a "what works" perspective. I 
amactually 85% of the tim all about what works, so not there is 
anythingwrong with it. But, I would like to hear some other rhoughts on 
itsince Validation is integral to just about every RIA that accepts 
dataon the planet.In MVC, the Validators seem to be more of a middle 
ground issue. Sincethe Model contains the business logic and is fed data to 
process andthe controller merely acts as waystation back and forth from view 
tomodel, it would seem to me that there should almost be another 
letterin MVC since validation doesn't really fit anywhere.However, 
it would seem to me that a Validation function would beplaced in the model 
itself. Since the view should only query the modelto get its current state 
and accept the user input, it seems it shouldnot be in the View to promote 
modularity. {myModel.dataIsValid == true}Because what if you wanted 
to add another View to the application??(As the OP mentioned) Seems to 
me like it would be malformed in the View.H... Perhaps MVCV - 
;)
__._,_.___





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








   






  
  
SPONSORED LINKS
  
  
  

Software development tool
  
  
Software development
  
  
Software development services
  
  


Home design software
  
  
Software development company
  

   
  







  
  
  YAHOO! GROUPS LINKS



   Visit your group "flexcoders" on the web. 
   To unsubscribe from this group, send an email to: [EMAIL PROTECTED] 
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  






__,_._,___



RE: [flexcoders] Re: Cairngorm... Where should this go?

2006-09-07 Thread Robert Stuttaford
It's quite simple. Validation is half of what business rules are. Validating 
that information is of a necessary format. The data
format (and thus, it's validation rules) are technology and presentation 
agnostic. The model should have the final say on whether
it's contents are currently valid or not.

Ruby on Rails has validation in the model, and the view has helper 
functionality which makes presenting validation errors easily...
But the actual validation itself happens on the model.

In Flex, the reason validators are in the views is because that's where we can 
-do- something about invalid data easily, ie
highlight a field, point a help bubble at it, stop the form from submitting etc.

I guess because Flex is a presentation framework, the emphasis is on the 
display of/interaction with data. The V is the primary
aspect. With Rails, since it's a full web stack, the validation sits where it 
logically should; in the model.

As to what to actually do with this information; go with the convention: stick 
it in the view. That's the way the framework has been
designed, and everything should fall into place with it.

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
lostinrecursion
Sent: 07 September 2006 10:28 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Cairngorm... Where should this go?

Sorry but I have to interject on this. Intsrestingly enough I asked a similar 
question some days ago and did not receive a response
from a design pettern perspective, but from a "what works" perspective. I am 
actually 85% of the tim all about what works, so not
there is anything wrong with it. But, I would like to hear some other rhoughts 
on it since Validation is integral to just about
every RIA that accepts data on the planet.

In MVC, the Validators seem to be more of a middle ground issue. Since the 
Model contains the business logic and is fed data to
process and the controller merely acts as waystation back and forth from view 
to model, it would seem to me that there should almost
be another letter in MVC since validation doesn't really fit anywhere.

However, it would seem to me that a Validation function would be placed in the 
model itself. Since the view should only query the
model to get its current state and accept the user input, it seems it should 
not be in the View to promote modularity.
{myModel.dataIsValid == true}

Because what if you wanted to add another View to the application??
(As the OP mentioned) Seems to me like it would be malformed in the View.

H... Perhaps MVCV - ;)






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links






 



--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.12.1/440 - Release Date: 2006/09/06
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.12.1/440 - Release Date: 2006/09/06
 



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

<*> To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





RE: [flexcoders] Re: Cairngorm... Where should this go?

2006-09-07 Thread Graham Pengelly












Yes, I’m with you on the ‘what
simply works’ attitude. I just thought that maybe the MVC pattern had
some direction on this kind of scenario. I have implemented your earlier
suggestion and it is working fine…


Thanks for your help.

 

Graham

Blog

 









From:
flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Dimitrios Gianninas
Sent: 07 September 2006 15:29
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Re:
Cairngorm... Where should this go?



 







I always do
"what simply works".

 

Sometimes I do
something, and days/weeks/months review it and see that it could be better/or
is causing a problem, so I refactor. I dont think there is one perfect way, it
also depends on the project as well sometimes.



 



Dimitrios
Gianninas

RIA Developer

Optimal Payments
Inc.



 



 







From:
[EMAIL PROTECTED]ups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of grahampengelly
Sent: Thursday, September 07, 2006
9:39 AM
To: [EMAIL PROTECTED]ups.com
Subject: [flexcoders] Re:
Cairngorm... Where should this go?



Thanks for your suggestion Dimitrios...

I had thought of that too but in the MVC architecture, doesn't that
put logic into the view? My impression of the architecture is that you
should be able to create a different view over the same model without
duplicating code. I mean, I don't want to have another view and am
more or less positive I never will but looking at it from a purist's
point of view is this the 'correct' way to do it?

I suppose if the rules that you validate against are kept within the
model ie. min and max allowable responses for the current question in
my case then your suggestion would be the 'correct' way of doing it.

I think I will go with your suggestion but I would be interested to
hear if you, or anyone else had any further opinions...

Thanks again...

Graham

--- In [EMAIL PROTECTED]ups.com,
"Dimitrios Gianninas"
[EMAIL PROTECTED]> wrote:
>
> Put a method to handle the validation of the form or forms in the
view. Then when the user presses the button, validate the form(s) and
if all is ok then fire the event that calls your command to do
whatever you want.
> 
> Dimitrios Gianninas
> RIA Developer
> Optimal Payments Inc.
> 
> 
> 
> 
> From: [EMAIL PROTECTED]ups.com
[mailto:[EMAIL PROTECTED]ups.com]
On Behalf Of grahampengelly
> Sent: Thursday, September 07, 2006 8:41 AM
> To: [EMAIL PROTECTED]ups.com
> Subject: [flexcoders] Cairngorm... Where should this go?
> 
> 
> 
> Hi
> 
> I am building an assessment application with Cairngorm. All is going
> swimmingly but I am wondering where I should put the following.
> 
> The view collects the respondents answers and fires off an event,
> containing them. The Controller picks this up and updates the Model...
> Pretty standard stuff.
> 
> My problem is that I need to validate the number of answers given. I'm
> new to the MVC pattern so I am not sure where this should go on. I
> want to give an alert or something like that to the user if the
> answers aren't valid. Should I just create the alert in the command
> that lives in the controller? This doesn't really seem right. Should I
> raise an event from the model and subscribe to this in the view. This
> seems more in keeping with what I perceive the roles of each aspect of
> the architecture to be but seems a bit convoluted.
> 
> At the end of the day I can get it to work in either of these and
> probably a few other ways but as I have embarked on this architecture
> I would like to make sure that I am doing it 'properly'...
> 
> Thanks in advance...
> 
> Graham
> 
> 
> 
> 
> 
> -- 
> WARNING
> ---
> This electronic message and its attachments may contain
confidential, proprietary or legally privileged information, which is
solely for the use of the intended recipient. No privilege or other
rights are waived by any unintended transmission or unauthorized
retransmission of this message. If you are not the intended recipient
of this message, or if you have received it in error, you should
immediately stop reading this message and delete it and all
attachments from your system. The reading, distribution, copying or
other use of this message or its attachments by unintended recipients
is unauthorized and may be unlawful. If you have received this e-mail
in error, please notify the sender.
> 
> AVIS IMPORTANT
> --
> Ce message électronique et ses pièces jointes peuvent contenir des
renseignements confidentiels, exclusifs ou légalement privilégiés
destinés au seul usage du destinataire visé. L'expéditeur original ne
renonce à aucun privilège ou à aucun autre droit si le présent message
a été transmis involontairement ou s'il est retransmis

RE: [flexcoders] Re: Cairngorm... Where should this go?

2006-09-07 Thread Dimitrios Gianninas





I always do "what simply works".
 
Sometimes I do something, and days/weeks/months review it 
and see that it could be better/or is causing a problem, so I refactor. I dont 
think there is one perfect way, it also depends on the project as well 
sometimes.
 
Dimitrios 
Gianninas
RIA 
Developer
Optimal 
Payments Inc.
 


From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On Behalf Of 
grahampengellySent: Thursday, September 07, 2006 9:39 
AMTo: flexcoders@yahoogroups.comSubject: [flexcoders] Re: 
Cairngorm... Where should this go?


Thanks for your suggestion Dimitrios...I had thought of that too but 
in the MVC architecture, doesn't thatput logic into the view? My impression 
of the architecture is that youshould be able to create a different view 
over the same model withoutduplicating code. I mean, I don't want to have 
another view and ammore or less positive I never will but looking at it from 
a purist'spoint of view is this the 'correct' way to do it?I suppose 
if the rules that you validate against are kept within themodel ie. min and 
max allowable responses for the current question inmy case then your 
suggestion would be the 'correct' way of doing it.I think I will go with 
your suggestion but I would be interested tohear if you, or anyone else had 
any further opinions...Thanks again...Graham--- In [EMAIL PROTECTED]ups.com, 
"Dimitrios Gianninas"[EMAIL PROTECTED]> 
wrote:>> Put a method to handle the validation of the form or 
forms in theview. Then when the user presses the button, validate the 
form(s) andif all is ok then fire the event that calls your command to 
dowhatever you want.> > Dimitrios Gianninas> RIA 
Developer> Optimal Payments Inc.> > > 
> > From: [EMAIL PROTECTED]ups.com 
[mailto:[EMAIL PROTECTED]ups.com]On 
Behalf Of grahampengelly> Sent: Thursday, September 07, 2006 8:41 
AM> To: [EMAIL PROTECTED]ups.com> 
Subject: [flexcoders] Cairngorm... Where should this go?> > 
> > Hi> > I am building an assessment application 
with Cairngorm. All is going> swimmingly but I am wondering where I 
should put the following.> > The view collects the respondents 
answers and fires off an event,> containing them. The Controller picks 
this up and updates the Model...> Pretty standard stuff.> > 
My problem is that I need to validate the number of answers given. I'm> 
new to the MVC pattern so I am not sure where this should go on. I> want 
to give an alert or something like that to the user if the> answers 
aren't valid. Should I just create the alert in the command> that lives 
in the controller? This doesn't really seem right. Should I> raise an 
event from the model and subscribe to this in the view. This> seems more 
in keeping with what I perceive the roles of each aspect of> the 
architecture to be but seems a bit convoluted.> > At the end of 
the day I can get it to work in either of these and> probably a few other 
ways but as I have embarked on this architecture> I would like to make 
sure that I am doing it 'properly'...> > Thanks in 
advance...> > Graham> > > > > 
> -- > WARNING> ---> This electronic message and 
its attachments may containconfidential, proprietary or legally privileged 
information, which issolely for the use of the intended recipient. No 
privilege or otherrights are waived by any unintended transmission or 
unauthorizedretransmission of this message. If you are not the intended 
recipientof this message, or if you have received it in error, you 
shouldimmediately stop reading this message and delete it and 
allattachments from your system. The reading, distribution, copying 
orother use of this message or its attachments by unintended 
recipientsis unauthorized and may be unlawful. If you have received this 
e-mailin error, please notify the sender.> > AVIS 
IMPORTANT> --> Ce message électronique et ses 
pièces jointes peuvent contenir desrenseignements confidentiels, exclusifs 
ou légalement privilégiésdestinés au seul usage du destinataire visé. 
L'expéditeur original nerenonce à aucun privilège ou à aucun autre droit si 
le présent messagea été transmis involontairement ou s'il est retransmis 
sans sonautorisation. Si vous n'êtes pas le destinataire visé du 
présentmessage ou si vous l'avez reçu par erreur, veuillez 
cesserimmédiatement de le lire et le supprimer, ainsi que toutes ses 
piècesjointes, de votre système. La lecture, la distribution, la copie 
outout autre usage du présent message ou de ses pièces jointes par 
despersonnes autres que le destinataire visé ne sont pas autorisés 
etpourraient être illégaux. Si vous avez reçu ce courrier 
électroniquepar erreur, veuillez en aviser 
l'expéditeur.>
 
  
  AVIS
  IMPORTANT
  
  
  WARNING
  
 
 
  
  Ce message électronique et ses pièces jointes peuvent contenir des renseignements confidentiels, exclusifs ou légalement privilégiés destinés au seul usage du destinataire visé.  L'expéditeur original ne renonce à aucun privilège ou à aucun autre d