AddChild Not working in a loop with custom component

Hi,
I have a custom component 'form component'
<?xml version="1.0" encoding="utf-8"?>
<mx:Form xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%">
    <mx:Script>
        <![CDATA[
            import mx.controls.Alert;
            import flash.net.navigateToURL;
            public var documentName:String;
            public var documentLocation:String;
            public var documentDescription:String;
            public var documentLevel:String;
            private function openLink():void
                var urlRequest:URLRequest=new URLRequest(documentLocation);
                navigateToURL(urlRequest,"_blank");
        ]]>
    </mx:Script>
    <mx:FormItem width="100%" height="100%" paddingRight="10" borderThickness="10">
        <mx:VBox width="100%" cornerRadius="10" borderThickness="2" borderStyle="solid" borderColor="#D5D2D2">
            <mx:ApplicationControlBar width="100%"  fillAlphas="[1.0, 0.52]" fillColors="[#FFFFFF, #B3CDD9]">
                <mx:LinkButton id="eachDocumentName" label="Name" click="openLink()" textAlign="left" width="50%" />
                <mx:Label id="eachDocumentLevel" text="Level" textAlign="right" width="50%"/>
            </mx:ApplicationControlBar>
            <mx:Label id="eachDocumentDescription" width="100%" text="Description" paddingTop="5"  paddingLeft="10"/>
            <mx:Label height="10" width="100%" />
        </mx:VBox>
    </mx:FormItem>
</mx:Form>
and I Want to add this component inside a VBox for a loop dynamically like
Script Code:
private function showDocuments(event:ResultEvent):void
                var documentList:ArrayCollection=event.result.root.documents.document;
                for(var i:int=0;i<documentList.length;i++)
                    var documentName:String=documentList[i].name.toString();
                    var documentDescription:String=documentList[i].description.toString();
                    var documentLevel:String=documentList[i].level.toString();
                    var documentLocation:String=documentList[i].location.toString();
                    createChildForFilePanel(documentName,documentLevel,documentDescription,documentLocation);
            private function createChildForFilePanel(documentName:String,documentLevel:String,documentDescription:Stri ng,documentLocation:String):void
                    Alert.show("function Called");
                    var documentListing:DocumentListing=new DocumentListing();
                    documentListing.percentWidth=100;
                    documentListing.percentHeight=100;
                    documentListing.eachDocumentName.label=documentName;
                    documentListing.eachDocumentLevel.text=documentLevel;
                    documentListing.eachDocumentDescription.text=documentDescription;
                    documentListing.documentLocation=documentLocation;
                    filePanel.addChild(documentListing);
MX: code
  <mx:VBox id="filePanel" label="File Content" width="100%" height="100%" borderThickness="0" >
      </mx:VBox>
This is actually Not working.. Am I doing anything wrong. I have included the component in the namespace..
Thanks In Advance,
Piyush

Its working now. The Solution to it what I found was whatever you are Adding To the Parent Component. The Parent Component should be created in the action script.
Worked for me :-)
Thanks,
Piyush

Similar Messages

  • I have a CC Photography License and tried loading the new Lightroom cc but it will not open (only flashes the welcome screen for a split second) then goes blank.  I tried uninstalling it, rebooting, etc. several times and it will not work on my Mac with Y

    I have a CC Photography License and tried loading the new Lightroom cc but it will not open (only flashes the welcome screen for a split second) then goes blank.  I tried uninstalling it, rebooting, etc. several times and it will not work on my Mac with Yosemite.  Please help!

    Check out this thread: Downloaded Lightroom CC but only get a quick flash of the startup screen then nothing, Lightroom 5 still working.

  • I got a iphone 5 but it does not work on my MacBook with Mac OSx 10.5.8  it says i need OSX 10.6.8 but it will not download because I need OSX 10.6 but it would load either. How do I get the older operating system to work with the IPhone5?

    I got a iphone 5 but it does not work on my MacBook with Mac OSx 10.5.8  it says i need OSX 10.6.8 but it will not download because I need OSX 10.6 but it would load either. How do I get the older operating system to work with the IPhone5?

    You don't. Since you have an Intel Mac, buy a Mac OS X 10.6 DVD from the online Apple Store.
    (71894)

  • The g, h and backspace on my keyboard are not working even after replacing with a new one.

    The g, h and backspace on my keyboard are not working even after replacing with a new one. I have also updated my BIOS still d same. Please help me ASAP.
    ...am waiting for a QIUCK RESPONSE

    How does a usb keyboard attached externally work?
    You might try a "hard reset" where you remove battery and AC charger, hold down power button 20-30 seconds and then reassemble and turn on. Reset BIOS (F10) to default settings, too. 

  • TS1702 I just bought a new iphone 5S and once turned on and pushed the button restore from Icloud, I'm stil stuck in this section i can't do anything plus i turned it off and on again and still not working, please provide me with a solution very urgently!

    I just bought a new iphone 5S and once turned on and pushed the button restore from Icloud, I'm stil stuck in this section i can't do anything plus i turned it off and on again and still not working, please provide me with a solution very urgently!!
    Kindly note also that i did not work on this iphone before, i just turned it on and i cannot connect it to the itune and restore it as the itune cannot read the device since i'm not able to reach my home screen, I am stuck in my restoring screen.
    Please help!!!!

    You dont have any data on your phone yet right?
    If you dont connect your device to the computer and
    Press and hold the Sleep/Wake button and the Home button together for at least 15 seconds, until the Apple logo appears.
    after that click okay when it says itunes has detected an iphone in recovery mode. Then click restore
    after that try again

  • [svn] 3913: BLZ-272 Two long polling endpoints not working in same app with Firefox

    Revision: 3913
    Author: [email protected]
    Date: 2008-10-27 13:49:02 -0700 (Mon, 27 Oct 2008)
    Log Message:
    BLZ-272 Two long polling endpoints not working in same app with Firefox
    The long polling waitMonitor object in the FlexSession did not keep track of
    blocking polls via endpoint ID. This prevented the second channel from blocking.
    Enhance the FlexSession.waitMonitor to be a map of endpointID to
    EndpointQueue objects, and keep track of the monitors based on what endpoint
    they are associated with.
    QA: Yes
    Doc:No
    Checkintests: passed
    Ticket Links:
    http://bugs.adobe.com/jira/browse/BLZ-272
    Modified Paths:
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/FlexSession.java
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/client/FlexClient.java

    Revision: 3913
    Author: [email protected]
    Date: 2008-10-27 13:49:02 -0700 (Mon, 27 Oct 2008)
    Log Message:
    BLZ-272 Two long polling endpoints not working in same app with Firefox
    The long polling waitMonitor object in the FlexSession did not keep track of
    blocking polls via endpoint ID. This prevented the second channel from blocking.
    Enhance the FlexSession.waitMonitor to be a map of endpointID to
    EndpointQueue objects, and keep track of the monitors based on what endpoint
    they are associated with.
    QA: Yes
    Doc:No
    Checkintests: passed
    Ticket Links:
    http://bugs.adobe.com/jira/browse/BLZ-272
    Modified Paths:
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/FlexSession.java
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/client/FlexClient.java

  • Soft KeyBoard is not working on ios 7 with Air sdk 3.8

    Hi
    In my app Soft KeyBoard is not working on ios 7 with Air sdk 3.8. Does any one know soluton for this ?

    Hi,
    There's no question that TextFields and TextAreas weren't working in our case, likely because we have a deep displaylist with a variety of object types. Presumably, AIR has changed how it looks through the displaylist for objects that need keyboard, and perhaps we have an object type somewhere in the hierarchy that AIR no longer recurses. It's definitely something that changed, though.
    It's no picnic to put together a sample app, I can't afford that time when I have a solution. But the symptom was very clear, a textbox would open, and the cursor would just blink with no way of interacting with it.
    I'm happy using StageText directly, because it's a more direct way to interact with the OS and gives more control.
    It also solves a bug in AIR that I haven't reported yet, but is as follows. Rarely, when you move the container of a TextField of TextArea after it has been created, AIR will crash and freeze iOS devices. It doesn't happen on Android or desktop, but with a user-base of about 100,000 of our app, we've had it reported maybe 50 times. One of our dialogs sometimes needs to reposition the elements, which is done animated. During this, AIR will crash about 0.01% of the time. We tried only creating the TextArea, but not activating it or even having it visible, but even an invisible TextArea will crash, presumably because AIR moves the internal StageText overlay around as well, and this confuses iOS after a while during the animation.
    By using StageText directly, I finally also have a way to get rid of this bug, because I simply don't activate StageText until the object has already been positioned. Prior to that, it isn't even an editable text field, it's a label like anything else. So I'm happy I did this solution.
    Let's just leave this thread as a record if someone else has the same problem. I'm quite sure it's because of our very complicated display list, and AIR having changed how it scans the displaylist for objects that need keyboard.
    Best,
    Per

  • SMS not working opinion iOS8.1 with iMessage on

    SMS is not working opinion iOS8.1 with iMessage on for multiple ppl. If we turn iMessage off and restart the phone SMS works (but obviously not iMessage). Is there a fix?

    Hi sfeth,
    Welcome to the Apple Support Communities!
    There may be a few different troubleshooting steps that I would recommend in this situation. Please use the troubleshooting steps outlined in the attached article for help resolving this situation. 
    iOS: Troubleshooting Messages - Apple Support
    Best regards,
    Joe

  • HT201412 Sound works (songs) on Ipad 2 but sound on videos (example utube) sound does not work. Video plays with no issue.

    Sound works (songs) on Ipad 2 but sound on videos (example utube) sound does not work. Video plays with no issue.Mute us not checked in general settings. Reboot (off/on) has not helped. Deleted apps and reloaded them. Did not help. Any other suggestions thank you

    If you lose sound for games or other apps, email notifications and other notifications, system sounds may have been muted.
    System sounds can be muted and controlled two different ways. The screen lock rotation can be controlled in the same manner as well.
    Settings>General>Use Side Switch to: Mute System sounds. If this option is selected, the switch on the side of the iPad above the volume rocker will mute system sounds.
    If you choose Lock Screen Rotation, then the switch locks the screen. If the screen is locked, you will see a lock icon in the upper right corner next to the battery indicator gauge.
    If you have the side switch set to lock screen rotation then the system sound control is in the control center. Swipe up from the bottom of the screen to get to control center . Tap on the bell icon and system sounds will return.
    If you have the side switch set to mute system sounds, then the screen lock can be accessed in the same manner as described above.
    This support article from Apple explains how the side switch works.
    http://support.apple.com/kb/HT4085

  • Dashboar with Custom Component Export to PPT

    Hello All
    any known issues exporting Xcelsius dashboard with custom component to PPT or PDF?
    i have a dashboard with a tree custom component , it works really fine and good into the review
    but when i exported to PDF or PPT it doesnt work at all
    when i go back and remove the custom component and i export, it works fine in PPT
    any clue?
    thanks
    Amr

    well, now its working fine
    dunn know whats the reason
    but i wanted to know if there is any limitation
    just removed the component and added it back
    thanks

  • Flex Print Job not working with custom component

    Hi All,
    I have to print pages with header, body and footer. So the thought process was to create a custom component fro header, footer and body. Header component is based on Box, Body is a renderer (which will have fix value of items - and will decide the number of possible pages) and footer is again based on Box.
    But when i created a simple Custom component like this for header
    <?xml version="1.0" encoding="utf-8"?>
      <mx:VBox  xmlns:fx=http://ns.adobe.com/mxml/2009
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:mx="library://ns.adobe.com/flex/mx">
    <fx:Declarations>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <mx:HBox>      <mx:Label id="testLabel" text="Test Container"/>
    </mx:HBox> 
    </mx:VBox>
    Then when i try to add this to FlexPrintJob, and save it as 'xps' to see the print output, i get error message that this file is in use or damaged.
        var myPrintJob:FlexPrintJob = new FlexPrintJob();
      if(!myPrintJob.start()){
          return;
    var header:Header = new Header();
    header.width = myPrintJob.pageWidth;
    header.visible = false;
    FlexGlobals.topLevelApplication.addChild(panierPrintHeader);
    myPrintJob.addObject(header);
    myPrintJob.send();
    FlexGlobals.topLevelApplication.removeChild(panierPrintHeader);
     But this does not work and i get the above mentioned exception. Now when i not use the custom component and just have a label or HBox or anything on stage before the print functionality is invoked, it works fine. And this too haapens only if you have a mxml component, i tried by creating a new Label component using actionscript and then provide the same to the printJob, which did not work either. I need help on this, else i will have to take print functionality to server side(Java) which has some business implications, the reason why i am spending time on flex for printing. 
    Thanks and Regards,
    Jigar
    Looks like custom component print is not working fine with flex or i am doing something terribly wrong.
    Looking forward for help.

    Is there nobody in flex community who can help on this....
    Looks like a toothless class that adobe actionscript team has provided, which is not liked across much

  • Forms Web application is not working on FireFox Browser-with java plugin

    Hi All,
    We are running custom build forms application using forms 10g and application server 10 g Rel 2. We are using Java Plug-in 1.5.0_06. The application is working fine before recent update from firefox .Now it's not working and keep on asking additional plug in required and taking to java.sun.com for installing the plug in. Even after installing when we access the application it will do the same thing. I tried uninstalling the firefox with the older version and with diffrent java plugin versions.. but the problem still there.. any help will be mush appriciated...
    Thanks...
    Edited by: rkadaru on May 5, 2010 1:57 PM

    plugin and webstart are not yet available in 64bit jre distributions from Sun.
    These are targeted to 6u12 or there abouts.
    /Andy

  • ContentPath not working in a loop for a Loader component

    i'm trying to load pics into a loader in my movieclip, i'm
    looping through about 20 items, to be placed in a movieclips
    dynamically attached...
    this does not work...
    mcContainer['node'+nCount].pic.contentPath=myimagepath;
    this does work...
    mcContainer['node'+nCount].pic.loadMovie(myimagepath);
    but it does not come in scaled / sized like I want...
    any reason why the images do not appear in the loader
    component in the movieclip? it's like the screen is not being
    refreshed or the loader never finishes, when I trace the
    contentPath after the fact it says the right path, but no image is
    there.

    contentPah is used to specify linkageID's only, and will not
    work for a URL. you correctly used the load method to get the
    picture in there, now you just have to scale it. if you set the
    loader's scaleContent to true, your image will scale to the
    loader's size, and vice versa if you set the property to false. if
    you need to do some custom scaling based on the size of the image,
    you can grab those properties like so:
    myLoader.content._width
    not that the above property, and any scaling commands, will
    only work after the loader finishes loading, so you'll need to put
    that stuff in an event handler for the loader.complete event...
    hope that helps

  • Partner function not working when creating PO with ref to PReq

    Partner function is not working when creating a Purchase Order with ref to a Purchase Requistion, Partner functions maintained in the vendor master are VN, OA & PI.
    But OA & PI are not appearing in the PO header partner tab when created with ref to PR.
    however it works when i create the PO directly ( without the PR ref )
    I am using the same material & Plant for both manual PO & PR to PO.
    Any idea what could be wrong .
    I have maintained the settings for schema groups for vendor master & purchasing doc in the partner determination.
    Thanks
    Dkmurthy

    Hi,
    I have also an issue that seems similar to one you are discussing.
    When we use ME59N and create a PO with ref. from a PR (created from a sales order), the message determination works well, it reads the condition set in MN04 (condition records for messages), and creates a message (with output type for EDI , medium: 6, and partner function LS: Logical system). Message is created and idoc is sent.
    When we try with ME21N, ME21 and we create the PO with ref. to the same PR, either by entering manually the PR in the document overview of ME21N or by selecting the PR (without entering the PR number), i.e with date, the message is not created in the PO.
    Company code is assigned to purchase organization, and so is purchase organization to plant.
    Any idea why there is no automatic message determination in the case of the transaction: ME21N
    Note: If I try ME21N, and enter the output type and partner, manually, I receive a warning message
    VN006 (Partner XXXX does not exist for partner function LS). If I accept this warning message, then message is saved- idoc is sent. However I can not overcome the warning message, if it plays any role, because I can not assign partner function LS to the vendor.Then I receive message CZ 327 (Can not use this partner role).
    Any input is wellcome.

  • The Create List Item workflow action does not work in document library with document template

    My end goal is more complex but below is a basic example of the issue I’m having that just simply does not work.
    I'm trying to use a site workflow to create an item in a document library that has a document template applied to it but the file that gets created by the workflow is corrupt and cannot be opened.
    I created a document library and edited the document template by adding some text to the header and changing it to a Word docx file instead of a Word dotx file. I tested the document template by clicking the files tab in the ribbon and then clicking new
    document which opens the document template in Word and allows me to edit and save the document back to SharePoint. Then I created a SharePoint 2013 site workflow in SharePoint Designer that contains a single Create List Item action, and that action creates
    an item in the document library with the name field statically defined. I published the workflow and then manually start it on the site. The workflow completes successfully and when I navigate to the document library the document has been created by the workflow.
    When I click on the document to open it in the Word Web App it throws the error pictured below and if I open it in the Word client application it just opens a blank document and not the correct document template.
    I also tried using a SharePoint 2010 workflow with pretty much the same results. Opening the document in Word Web App gives the same error as above and opening the document in the Word client application gives the error pictured below.
    Come on Microsoft creating a Word Document in a SharePoint Document Library from a SharePoint Workflow should just work! Is this a bug or does anyone have any ideas on what is causing the this issue?

    I had the same problem with corrupted document - this worked for me:
    1. Create a 2010 Workflow which creates the list element in a document library
    (you may start this workflow from your 2013 workflow if applicable)
    2. In the Create New List Item properties - make sure to set ContentTypeId to your content type
    ("Id for indholdstype" is Danish for "Contenttype ID")
    3. Your Content Type template should be a ".docx" file - NOT a ".dotx" file...!
    (I have always created my templates for content types as .dotx files - seems Microsoft wants us to use ordinary .docx files as template files for content types)
    Hope this helps you!

Maybe you are looking for