Help with article from learning Flex

Hi,
I was trying the examples on the Learning Flex site:
http://www.adobe.com/devnet/flex/articles/datamodel_print.html
I did manage to fix all the compile issues (Flex 1.5 to 2.0)
but I stll cannot get it to work.
For starters it doesn't load the info from the xml files.
Second if I use the following :
<mx:DataGrid id="empGrid" dragEnabled="true"
dataProvider="{empModel.employee}"> it gives an error when
trying to add a new employee
if I use:
<mx:DataGrid id="empGrid" dragEnabled="true"
dataProvider="{empModel}"> it adds it properly (minus the
Location which doesn't get loaded). Also when used this way it adds
scroll bars around the panel.
Can somebody explains why it doesn't load and what is the
difference between:
dataProvider="{empModel.employee}" and
dataProvider="{empModel}"
I have attached the modified files:
emplProk.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
xmlns="*" layout="absolute">
<mx:Script>
<![CDATA[
import DataController;
]]>
</mx:Script>
<mx:Model id="newEmpModel">
<fName>{fNameInput.text}</fName>
<lName>{lNameInput.text}</lName>
<location>{locCombo.selectedItem}</location>
</mx:Model>
<mx:Model id="empModel" source="employees.xml"/>
<mx:Model id="locModel" source="locations.xml"/>
<DataController id="dataController"/>
<mx:HBox>
<mx:Panel id="empPanel" title="Employee Data"
height="{engPanel.height+supPanel.height}">
<mx:DataGrid id="empGrid" dragEnabled="true"
dataProvider="{empModel.employee}">
<mx:columns>
<mx:Array>
<mx:DataGridColumn dataField="fName" headerText="First
Name" />
<mx:DataGridColumn dataField="lName" headerText="Last
Name" />
<mx:DataGridColumn dataField="location"
headerText="Location" />
</mx:Array>
</mx:columns>
</mx:DataGrid>
<mx:Form>
<mx:FormHeading label="Add New"/>
<mx:FormItem label="First Name">
<mx:TextInput id="fNameInput"/>
</mx:FormItem>
<mx:FormItem label="Last Name">
<mx:TextInput id="lNameInput"/>
</mx:FormItem>
<mx:FormItem label="Location">
<mx:ComboBox id="locCombo" dataProvider="{locModel}"/>
</mx:FormItem>
</mx:Form>
<mx:ControlBar>
<mx:Button label="Add Employee"
click="dataController.addNewEmp(newEmpModel,empGrid.dataProvider)"/>
</mx:ControlBar>
</mx:Panel>
<mx:VBox>
<mx:Panel id="engPanel" title="Engineering Group"
width="{empPanel.width}">
<mx:DataGrid
dragEnter="dataController.doDragEnter(event)"
dragDrop="dataController.doDragDrop(event)">
<mx:columns>
<mx:Array>
<mx:DataGridColumn dataField="fName" headerText="First
Name" />
<mx:DataGridColumn dataField="lName" headerText="Last
Name" />
<mx:DataGridColumn dataField="location"
headerText="Location" />
</mx:Array>
</mx:columns>
</mx:DataGrid>
</mx:Panel>
<mx:Panel id="supPanel" title="Support Group"
width="{empPanel.width}">
<mx:DataGrid
dragEnter="dataController.doDragEnter(event)"
dragDrop="dataController.doDragDrop(event)">
<mx:columns>
<mx:Array>
<mx:DataGridColumn dataField="fName" headerText="First
Name" />
<mx:DataGridColumn dataField="lName" headerText="Last
Name" />
<mx:DataGridColumn dataField="location"
headerText="Location" />
</mx:Array>
</mx:columns>
</mx:DataGrid>
</mx:Panel>
</mx:VBox>
</mx:HBox>
</mx:Application>
Employee.as
package
public class Employee
// properties
public var fName:String;
public var lName:String;
public var location:String;
// constructor
public function Employee()
// methods
public function
addEmpData(fName:String,lName:String,location:String):void
this.fName=fName;
this.lName=lName;
this.location=location;
DataController.as
package
import flash.events.MouseEvent;
import mx.events.DragEvent;
public class DataController
import mx.managers.DragManager;
import Employee;
// constructor
public function DataController()
// methods
public function addNewEmp(src:Object,dest:Object):void
// create an Employee object
var tmpObj:Employee=new Employee();
// add the new data to the object properties
tmpObj.addEmpData(src.fName,src.lName,src.location);
// add the employee object to the destination dataProvider
dest.addItem(tmpObj);
public function doDragEnter(event:DragEvent):void
// allow drop
//event.handled=true;
// set action to copy
event.action = DragManager.COPY;
public function doDragDrop(event:DragEvent):void
event.dragSource.dataForFormat("items") returns
an array of dragged data items
var items:Object = event.dragSource.dataForFormat("items");
// for convenience, set var for drop target
var dest:Object = event.target;
// copy the item target's dataProvider
addNewEmp(items[0],dest);
employees.xml
<?xml version="1.0"?>
<employees>
<employee>
<fName>
Clare
</fName>
<lName>
DuPre
</lName>
<location>
Paris
</location>
</employee>
<employee>
<fName>
David
</fName>
<lName>
Green
</lName>
<location>
San Francisco
</location>
</employee>
</employees>
locations.xml
<?xml version="1.0"?>
<locations>
<location>
Paris
</location>
<location>
Tokyo
</location>
<location>
Cairo
</location>
<location>
San Franscisco
</location>
</locations>
Text
Text
empModel.employee
="{empModel

I have tried just a small example , with a data grid and an
embeded XML doc and it works fine.
If I move the xml to an external file and use <mx:Model
... it doesn't show up, so it seems that is something wrong with
the model
Can please somebody verify it.
Thanks

Similar Messages

  • Please i need help with switch from the us store to malaysian store how i can switch

    Please i need help with switch from the us store to malaysian store how i can switch

    Click here and follow the instructions to change the iTunes Store country.
    (82303)

  • RSS Feed with articles from Creative Knowledge B

    Over 40 MP3 articles from Creative Knowledge Base are available in RSS Feed:
    Creative Knowledge Base | MP3 Players
    Other Feeds

    I got it to work, but I'm not going to share the solution with anyone because nobody even tried to help at all and I'm not sure what caused it in the first place.

  • HT1766 I need help with restore from bachup

    I NEED HELP WITH MY IPAD RESTORE FROM BACKUP

    This is the iPod touch forum and you are not providing any information to help you.

  • Help with download from computer to ipod touch

    Is there a way to sync music that I saved on my laptop to my daughters ipod without having to pay 25.00 monthly it is just two cds i bought for her for christmas i wouldn't use the icloud match enough to justify Thank you

    See if this helps:
    iTunes 11 for Windows: Syncing overview
    If the iPod does not apper in iTunes
    Try
    iOS: Device not recognized in iTunes for Windows
    I would start with               
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
    or               
    Removing and reinstalling iTunes and other software components for Windows Vista, Windows 7, or Windows 8
    New cable and different USB port?
    Runs this and see if the results help with determine the cause
    iTunes for Windows: Device Sync Tests
    Try on another computer to help determine if computer or iPod problem

  • Help with Error message in Flex 2.0 while trying to import from a library of classes

    The following code is in a folder named saras. Inside saras
    is a file named saras.as and a library of classes named
    ASCB3Library. I downloaded this library after I purchased a book
    named ActionScript 3.0 CookBook. I have tried every way I know for
    a full week to instantiate the pen class from the library. I have
    e-mail the book publishers and I understand that the author has
    changed jobs --- I definately am not trying to make any bad
    references --- I am simply asking for help --- there must be
    someone out there with my same problem --- I am nottoo sharp but I
    am not so obtuse as I seem to be making myself.
    package {
    import flash.display.Sprite;
    import ASCB#Library.classes.ascb.drawing.Pen;
    //import ascb.drawing.Pen;
    public class saras extends Sprite
    public function saras() {
    var pen:Pen = new Pen(graphics);
    pen.drawArc(100,100,50,80,20, true);
    graphics.lineStyle(1,0,1);
    graphics.lineTo(300,200);

    As far as I know, iWork (without a s) was never depicted as opening _"all Excel documents"_ but as _"opening Exel documents"_ which means that it open _many of them but not all_ .
    Is it surprising that it is unable to open documents created with an Excel version introduced after the Numbers creation ?
    To get it able to open them, you will have to wait for the next major version.
    Yvan KOENIG (from FRANCE lundi 20 octobre 2008 17:16:32)

  • Help With Migration From Exchange 2007 To Exchange 2013

    We have an Exchange 2007 Server with Service Pack 3 and Rollup 12 applied. 
    I installed a new Exchange 2013 Server and then immediately applied CU3.
    I am following this Technet article:
    http://blogs.technet.com/b/meamcs/archive/2013/07/25/part-1-step-by-step-exchange-2007-to-2013-migration.aspx
    The only deviation from the instruction I have had to do is in Part 2, section 4 “Configure offline address book (OAB)”. 
    Instead of entering:
    Get-MailboxDatabase | Set-MailboxDatabase -OfflineAddressBook "\Default Offline Address Book (Ex2013)"
    I had to enter:
    Get-MailboxDatabase | Set-MailboxDatabase -OfflineAddressBook "\Default Offline Address Book (Ex2012)"
    I believe this is due to the fact that the writer installed from an Exchange 2013 CU1 disk and I only had Exchange 2013.
    Also when I tried to run:
    Move-OfflineAddressBook -Identity "Default Offline Address Book" -Server SRV-EX2013
    I get the following error:
    Move-OfflineAddressBook : Failed to create the 'ExchangeOAB' folder on the target server 'SRV-EX2013'. Two possible reasons for the failure are that the System Attendant Service is not running or you do not have permission to perform
    this operation. Error message : 'Catastrophic failure (Exception from RESULT: 0x8000FFFF (E_UNEXPECTED))'.At line:1 char:24+ Move-OfflineAddressBook <<<< 
    -Identity "Default Offline Address Book" -Server SRV-ex2013+ CategoryInfo         
    : InvalidResult: (Default Offline Address Book:OfflineAddressBookIdParameter) [Move-OfflineAddressBook], LocalizedException  
    + FullyQualifiedErrorId : 9250969C,Microsoft.Exchange.Management.SystemConfigurationTasks.MoveOfflineAddressBook
    However when I looked at the address books in EAC I could see that “Default Offline Address Book (Ex2012)” was the default and that it contained a copy of the Global Address List. So I did nothing else about it.
    I am now at Part 3, section 7 “Move Mailboxes” and it keeps failing. 
    I am using the EAC so that I at least see the error as using the powershell brings back no results. 
    Anyway it Syncs the 18 items in the mailbox then fails with:
    Data migrated: 936.7 KB ‎(959,145 bytes)‎
    Migration rate: 0 B ‎(0 bytes)‎
    Error: MigrationPermanentException: Error: An error occurred while updating a user object after the move operation. --> Unable to generate the e-mail address. Unable to load address module ‎'C:\Program Files\Microsoft\Exchange Server\V15\Mailbox\address\SMTP\AMD64\inproxy.dll‎'
    for address type ‎'SMTP‎'. Additional message: ‎'Access is denied‎'.
    Help??
    Tony

    Hi,
    You can't configure Exchange 2013 to generate other OAB versions, and the OAB generation occurs on the Mailbox server on which the organization mailbox resides.Therefore, to move OAB generation in Exchange 2013, you must move the organization mailbox. You
    can only move the OAB generation to another Exchange 2013 mailbox database. You can’t move OAB generation to a previous version of Exchange.
    And please refer to the following articles :
    Moving OABs between Exchange versions
    If you want to upgrade from exchange 2007 to exchange 2013,I recommend you refer to the following article:
    Upgrade from Exchange 2007 to Exchange 2013
    Exchange   version
    Exchange   organization coexistence
    Exchange 2007
    Supported with the following   versions of Exchange:
    Update Rollup 10 for Exchange        2007 Service Pack 3 (SP3) on all Exchange 2007 servers in the       
    organization, including Edge Transport servers.  
    Exchange 2013 Cumulative        Update 2 (CU2) or later on all Exchange 2013 servers in the       
    organization.
    Install Exchange 2013 in an Existing Exchange 2007 Organization
    You can install a Microsoft Exchange Server 2013 server into an existing Exchange Server 2007 organization, and then move the Exchange resources, such as mailboxes, public folders, and connectors, to Exchange 2013. However, you can't perform an in-place
    upgrade from Exchange 2007 to Exchange 2013.
    Hope this helps!
    Thanks.
    Niko Cheng
    TechNet Community Support

  • Help with switching from Windows to Mac

    Does anyone know of any good sites that can help in teaching somebody how to use the mac operating system? Thanks

    Hi, bato123.
    My "Learning About Mac OS X" FAQ has a number of resources that you will find helpful including books, online training, and more.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X
    Note: The information provided in the link(s) above is freely available. However, because I own The X Lab™, a commercial Web site to which some of these links point, the Apple Discussions Terms of Use require I include the following disclosure statement with this post:
    I may receive some form of compensation, financial or otherwise, from my recommendation or link.

  • Need help with adding a Key flex field to a seeded OAF page

    We have a seeded OAF page on which we already have Account Key Flex Field.
    Properties of this flex field are:
    The ApplShortName - SQLGL
    Name - GL#
    Type - Key
    As per the client requirement, in the KFF screen, we have disabled the seeded structure for Accounting Flexfield and created a custom structure.
    Our custom structure for the KFF is displayed correctly on the OAF page.
    But now the requirement is to add a new KFF on the OAF page which is duplicate of the existing KFF, along with the existing KFF field; the structure and segments are same. Only difference being the display name of the existing KFF field is Account; the new one needs to be Tax structure.
    Using personalization we added a new flex item and added the properties same as the existing KFF.
    ApplShortName - SQLGL
    Name - GL#
    Type - Key
    But the page is giving following error:
    The data that defines the flexfield on this field may be inconsistent. Inform your system administrator that the function: KeyFlexfieldDefinitionFactory.getStructureNumber could not find the structure definition for the flexfield specified by Application = SQLGL, Code = GL# and Structure number =
    We tried options like compiling the flexfield definition, but the error persists.
    Any help in this regard is highly appreciated.
    Regards,
    Kiranmayi.

    Hi,
    Please check whether your key flex structure is frozen or not. If now please freeze it and re compile and try.
    This may helps too
    error while developing KFF in oaf
    Thanks
    Bharat
    Edited by: Bharat on May 10, 2013 4:51 AM

  • Need help with upgrade from Adobe Creative Suite to PS CS4

    My old laptop with Photoshop on it crashed and I ended up purchasing a new laptop.
    I'm trying to reload my PS CS4.  I am using an upgrade from an educational Adobe Creative Suite Premium to the CS4 and when I loaded it on my old laptop I had to get installation help through customer service, but now customer service will not help me since it is CS4.
    When installing the upgrade, it tell me to select the product I already own.  I own the educational full creative suite, but am only upgrading the Photoshop.  I chose Photoshop CS and tried entering the serial number for the suite.  It tells me that the serial number doesn't match the product chosen.  Of course the only products I'm allowed to choose from is Photoshop CS, CS2, or CS3 and not Creative Suite Premium.
    The other serial numbers on this CS is Golive CO and Pagemaker Plug-in.
    I was told there are Adobe customer service reps here on the forum, please tell me what it was I need to do to get my Photoshop installed.
    Thanks

    i wasn't aware that you could get a ps4 at an upgrade price using an older creative suite produect.  i searched online and found this thread (http://forums.adobe.com/thread/476009) which makes it appear that was not a valid upgrade path.
    but, if you're confident that was a valid upgrade path, i'm pretty sure something will need to be done on adobe's end and no amount of manipulation, on your end only, will work.
    your best bet would be to get help in this forum from an adobe staff member like jeff wright who is very knowledgeable and goes out of his way to help adobe customers.  to that end, if i were you, i would start a new thread mentioning his name in your title and in your initial post explaining:
    you have the educational Adobe Creative Suite Premium and purchased a photoshop cs4 upgrade years ago that required adobe support help to install years ago. 
    that worked well until a recent computer problem forced you buy a new laptop and you are now trying to reinstall that ps cs4 and again need support help but have been refused help because cs4 is not current.

  • In need of help with Shockwave from experts and community please.

    I have seen posts where people are having the same issue with Chrome, but I am using Windows 8 playing my FB games using Firefox. I have filled out their little "box" that they ask me to about 10 times and I am over it. I went to see if my Adobe SW was installed right, but it doesn't show anything moving. The strange thing is...I had already uninstalled it and reinstalled it the day before. I do have screen shots that I would like to share, and I am asking if anyone else is getting this same error.
    ***What happens is I will be playing my game and then "poof" out of nowhere the 2 tabs I had opened are gone and I am back to my desktop.
    ***Another issue that comes up all the time, and then the tabs will close, is that a small rectangular box will come up and it goes away so fast you don't get a chance to read it.
    But as I said I have screen shots.
    Everything on my computer is up to date, my husband works in the IT field and he can build a computer from the guts up. That's how I know it is not on my end. Y'all don't know how much I really do appreciate the fact that you took the time to read my post and any suggestions on how to solve this issue.
    Have a very great day,
    snoopyfan6200
       ********** As you see I am a Huge Snoopy Fan. I have about 450 items in my collection.  And the 6/2/00....well that was the day my Dad passed away.********

    Hi,
    This is a forum for Adobe FormsCentral. Please post your questions on Flash Player forum at http://forums.adobe.com/community/flashplayer. I believe you'll get help over there.
    Thanks,
    Wenlan

  • Help with migrating from PPC G5 to MacBook Pro 2012

    I haven't even booted up my new MacBook Pro, because a lot of postings in Discussions and elsewhere warn me of problems if I try to use Migration Assistant to bring my user data and files across from a PPC Mac to a new MacBook Pro running Lion.
    BORING DETAILS:  I'm jumping from a dual G5 Dual Power Mac (PPC, running Leopard 10.5.8) over to a 2012 MacBook Pro, (a 15" fast i7 quad non-retina, with 1 GB GPU and 16 GB RAM, running latest Lion). I have a lot of data and apps, including "pro apps" like Final Cut and lots of photo- and video-production software.
    I know that I'll need to reinstall all my apps from scratch, even Universals, especially all my Pro apps. But, I have read some positive guidance about possibly using Migration Assistant to move only my User identity and related files across to the MBP. Then, reinstalling / upgrading apps. And, afterwards, using Firewire (target mode) to move various data folders and docs.
    I'm confused. I like the idea of moving myself as User/admin across, relatively intact -- IF that's a good idea -- then reinstalling apps. Then, moving various files (docs andand data) across. Hopefully, this route wind up with minimal or zero PERMISSIONS  problems. Guidance or links, pretty please...?
    I've read the great postings from Kappy and some others, in Discussions, but most don't address the issue of moving User identity and data from the PPC Mac over to the Intel. Maybe it's a "big" issue only in my mind?

    Joshua Coventry and sig and others:
    Thanks!
    If you combine those last two pieces of advice and mix in the best of the earlier suggestions, that's pretty much what I wound up doing:
    I used Setup Assistant to create a "NewGuest" account on the MacBook Pro, with minimal information submitted to Apple (basically, only my correct name and address, etc.). Then I immediately used the Migration Assistant to bring over ONLY 1) my main User admin account and its Home folder and 2) the computer settings from the G5 Power Mac.
    Finally, I changed the "NewGuest" to a regular account (non-admin), rebooted the MPB, and deleted NewGuest and its home folder. Then began the long job of feeding appropriate software into my new MBP: installing or reinstalling the latest Intel versions of all of my key productivity apps and utilities.
    So far, I'm getting very good results. No MBP indigestion, but it's daunting to look at a new Dock that's now almost totally populated by question marks (the G5's Dock had almost fifty apps)! There's one major benefit: a chance to reconsider whether I really needed all of that stuff to begin with, and if I need it now!
    The need-it-now vital stuff is being pulled over via Firewire, and I've just bought an external USB 3 enclosure for the G5's main boot drive, and it will now be available as a handy source for various files, docs, settings as I need them, and for any "second thoughts" that I might have about what really belongs on the MacBook Pro's boot disk. All is well, and it looks like it will STAY well (but stay tuned!).
    Thanks, y'all! Hope this helps someone else facing a similar challenge.

  • Need help with mail from pc

    I received some mail from outlook that had some odd characteristics and I'm hoping that someone can help me figure out how to get it to display normally.
    1. no header information (I don't see who the sender is, subject, etc. in Mail). The top of the message looks like this:
    ------=NextPart_000_002201C7B31B.65BC0BE0
    Content-Type: multipart/alternative;
    boundary="----=NextPart_001_002301C7B31B.65BC0BE0"
    ------=NextPart_001_002301C7B31B.65BC0BE0
    Content-Type: text/plain;
    charset="us-ascii"
    Content-Transfer-Encoding: 7bit
    2. There are embedded table in the message that in one column instead of multiple columns.
    In both cases, I can view the messages okay if I log onto the webmail server.

    I got it working i tried all the ISO files from microsoft media creation tool and none worked and i dont know why but i checked the sticker on my pc "windows 8.1 with bing" so i googled windows 8.1 with bing iso, donwloaded it and now the key worked

  • HT1296 Need help with sync from phone to computer

    When I sync my phone to my laptop, I would like info I entered on the calendar on my phone to be added to the calendar on my computer.  I can only get it to sync from computer to phone.  I need to update both
    any ideas.  I have searched the help files and can't find this anywhere

    My problem is similar. I just upgraded from the 4S to the 5 and I used to be able to sync the calendar on my iMac and iPhone using iCloud without getting duplicates by selecting/deselecting the appropriate calendars on the respective devices. Everything synced as I entered it. 
    I'm pretty sure it was working with the 5 until recently...
    Today I noticed that an event I entered on the 5 for last week didn't show up on my iMac. When I checked the EDIT screen on the phone to see what calendars were checked, only the calendar for that event was (on the All on my iPhone).  All but the Unfiled calendar are checked on the All on my iCloud.  When I unchecked and rechecked the calendars under the Phone didn't help. Can't get the thing to sync...
    Seems like most people are having problems with Exchange accts, but here I am with my iMac/Phone/Cloud...

  • Can someone help with buying from international stores?

    Can someone please help? I am trying to get a program from U.S i tunes store and it won't let me because mine is in Aussie dollars.
    Any leads would be great.

    The issue of cross store purchasing comes up frequently so I'll just quote one of the most complete explanations (courtesy of Dave Sawyer) from the many given:
    The content owners do not allow cross-border sales from any of the legal download stores (not Apple or the proprietors of any of the other stores). You must therefore have legal residence in the country of the iTunes Store you wish to use. So in order to buy from another country's iTunes Store, you must (as proof of residence) have either:
    a) a credit card issued by a bank in that country with a billing address also in that country, or
    b) a mailing address for your residence in that country and a gift certificate or a prepaid card that was bought in that country.
    If you cannot fulfill one of these two sets of conditions, you will not be able to purchase from any given country's iTunes Store.
    This, again, is due to restrictions placed on Apple by the media companies and other copyright holders (who are often completely different from country to country and so all require their own individual negotiations and contracts), not by Apple's choice.

Maybe you are looking for

  • Change the Purchase Order : Item - Conditions value

    Hi, How to change the Purchase Order : Item - Conditions value. In my PO, Item conditions shows the SKTO - Cash Discount value is 0. I want to change the Discount value 10. How can i change it??

  • Error Differance is too large for Customer clearning

    Hi, When I am trying to clear the customer f-32 i am getting the error as "(F5 263) The difference is too large for clearing". Excise invoice is created in USD . when i clear the payment in indian currency the erors occurs. Request you to please help

  • BI and ECC 6.0 installation in the same server

    Hello SAP Experts, I am given a task of installing BI 7.0 and ECC 6.0 in the same server. Can someone suggest me of what are all the Do's and Don'ts in this scenario and what is the hardware requirements. Thanks & Regards Vanitha

  • Floating point image resize?

    I can't find any method which allows a floating-point image sizing. I guess what I need is something like float x, y, width, height; g2d.drawImage(image, x, y, 0, width, height, null); Is such a thing possible in Swing? I'm animating a shrinking icon

  • OS X Remote Desktop is not working with Azure Cloud Machines or Azure Pack Machines

    Hi, i can't connect to any Machine via Console. I'm Working with Machines in Azure Pack and in Cloud. The connection causes a Authentication Loop. Best Regards