I tend to put such code in the corresponding ViewHelper class, so every view (MXML file) has a corresponding ViewHelper class. See sample below:
 
Inboxes.mxml
<mx:Box>
    ...
    <vw:InboxesViewHelper id="inboxesHelper" view="{this}"/>
     ...
 
    <mx:List id="inboxList" width="165" height="100%" labelField="name"
            vScrollPolicy="auto" change="inboxesHelper.doLoadInbox(inboxList.selectedItem.id)" />
 
     ...
</mx:Box>
 
Jimmy Gianninas
Software Developer - Optimal Payments Inc.
 


From: Robert Brueckmann [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 03, 2005 9:14 AM
To: [email protected]
Subject: RE: [flexcoders] Theory and Practice: Mixing AS2.0 in MXML

Can I ask how you manage an MXML without any ActionScript at all?  How in a file that has components with click or change listeners would you not have any supporting ActionScript code…I mean just about every single one of my MXML fileshas initialize or creationComplete listeners in the parent container tag with dozens of other components that are dependent on dataproviders changing and user interactions like clicking or dragging and dropping and I can’t beginto imagine how I could extract every bit of ActionScript from my MXML files into individual ActionScript classes…maybe I’m not grasping the Cairgorm designarchitecture fully…I thought I had a pretty good grasp on it but to hear that you’re writing MXML files with no ActionScript in them whatsoever kind of baffles me…can you give me an example?

Thanks for bearing with me!  ;)

Robert L. Brueckmann

Web Developer

Merlin Securities, LLC

595 Madison Avenue

New York, NY 10022

p: 212.822.4821
f: 212.822.4820


From: Dimitrios Gianninas [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 03, 2005 8:31 AM
To: [email protected]
Subject: RE: [flexcoders] Theory and Practice: Mixing AS2.0 in MXML

DataBinding is definitely one of the high points of Flex and is used very often in our first Flex implementation here at Optimal. I see no need to stop using a feature that helps make development easier and quicker.

We are now creating prototype Flex UIs for 3 other projects, none of these UIs are functional, they are mostly screen mock ups. However one of the first things we do is use data binding to say connect a DataGrid to a form to show end-users what the final product might do, so in this case data binding is easily and quickly used for prototyping minimal functionality in a UI.

As for the "don't ever include AS2 code in MXML ever", well I have to agree with Steven on that one. As I browse through my MXML code, 65% of the MXML files don't contain AS2 code at all, however the other 35% do in some small fashion because it didn't warrant a full blown AS2 class to implement 2-3 lines of AS2 code to do something. Like Steven said, I pretty much think this decision is left up to the developer as to how much AS2 code to leave in a MXML file and when it is time to re-factor it into an AS2 class.

Jimmy Gianninas

Software Developer - Optimal Payments Inc.


From: Steven Webster [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 03, 2005 7:01 AM
To: [email protected]
Subject: RE: [flexcoders] Theory and Practice: Mixing AS2.0 in MXML


> > On a similar note, data binding is an immensely powerful
> feature of Flex;
>
> And one that is great for quick-and-dirty hacks and
> prototyping but it doesnot belong in a large-scale application where
> maintainability and scalability concerns outweighthe hazards of
introducing
> such logic into your MXML.

I can't belive thatyou have reduced data binding to "quick and dirty hacks"
and "prototyping" !

I can't understand how databinding threatens maintainability (on the
contrary, it providesan elegant way of expressing an entirely common
requirement of listening and notifications) nor can I understand how
databinding threatens scalability.

I very much doubt there are any real-world Flex implementations out
there today, where data binding usage is the make or break between
whether the app is scalable and maintainable or not.

Promoting "no ActionScript 2.0 at all in MXML" to the wider development
community, and extending that to include data-binding, is something that
makes me incredibly nervous...and I suspect that as well as most real-world
implementations having benefited greatly from data-binding, the architects
and engineers responsible for these implementations would in no-way
consider their deliveries to have been "hacked" or "prototypes".

I'd be curious as to what the others who have shipped apps into
production with Flex think on this ?  Would you advocate removing
all data binding from your "large-scale application" before
moving into production ?

I wouldn't; but I'd be interested to hear other thoughts...

Steven

--
Steven Webster
Technical Director
iteration::two

This e-mail and any associated attachments transmittedwith it may contain
confidential information and must not be copied, or disclosed, or used by
anyone other than the intended recipient(s). If you are not the intended
recipient(s) please destroy this e-mail, and any copies of it, immediately.

Please also note that while software systems have been used to try to ensure
that this e-mail has been swept for viruses, iteration::two do not accept
responsibility for any damage or loss caused in respect of any viruses
transmitted by the e-mail. Please ensure your own checks are carried out
before any attachments are opened.



AVIS IMPORTANT

WARNING

Les informations contenues dans le present document et ses pieces jointessont strictement confidentielles et reservees a l'usage de la (des) personne(s) a qui il est adresse. Si vous n'etes pas le destinataire, soyez aviseque toute divulgation, distribution, copie, ou autre utilisation de ces informations est strictement prohibee. Si vous avez recu ce document par erreur, veuillez s'il vous plait communiquer immediatement avec l'expediteur et detruire ce document sans en faire de copie sous quelque forme.

The information contained in this docu! ment and attachments is confidential and intended only for the person(s) named above. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution, or any other use of the information is strictly prohibited. If you have received this document by mistake, please notify the sender immediately and destroy this document and attachments without making any copy of any kind.




 

This message contains information from Merlin Securities,LLC, or from one of its affiliates, that may be confidential and privileged. If you are not an intended recipient, please refrain from any disclosure, copying, distribution or use of this information and note that such actions are prohibited. If you have received this transmission in error, please notify the sender immediately by telephone or by replying to this transmission.
Merlin Securities, LLC is a registered broker-dealer. Services offered through Merlin Securities, LLC are not insured by the FDIC or any other Federal Government Agency, are not deposits of or guaranteed by Merlin Securities, LLC and may lose value. Nothing in this communication shall constitute a solicitation or recommendation to buy or sell a particular security.

Reply via email to