How to access component's control property from main .mxml file

I have a main .mxml while in which i imported custom
"popUpWindow" component using "import component.popUpWindow"
statement. In main .mxml file I display later on that component as
popUp window using popUp manager class. Once component is
displayed, how can i access using actionscript component's
TextInput control (specifically its .text property) from my main
.mxml file?
thanks

I posted this answer elsewhere, maybe it will help:
First, save the new component wherever you keep your
components, let's say you call it "MyPopWindow.mxml"
Assign public variables for the string in both the main app
and the popup.
In your case, in the main app:
Code:
public var myText:String = "whatever the text field should
say.";
and then in the pop up mxml:
Code:
[Bindable]
public var myText;
Then, in the main mxml file:
Code:
// define the window type
private var popWin:MyPopWindow;
private function popMeUp(event:MouseEvent):void{
popWin =MyPopWindow(PopUpManager.createPopUp(this,
MyPopWindow, true));
popWin.myText = myText;
The important things here to notice is the name of the
component (i.e. the file) is used. A variable is created for the
window, and TYPED to your file name. Then you use the constructor
you already had, but again use your type. The "true" is optional
and gives you a modal popup window.
Lastly, assign the variable in the window (I called mine
popWin) to the variable in the main file you want to pass.

Similar Messages

  • How to access component's control from main .mxml file?

    I have a main .mxml while in which i imported custom
    "popUpWindow" component using "import components.popUpWindow"
    statement. In main .mxml file I display later on that component as
    popUp window using popUp manager class:
    var popUpWin:IFlexDisplayObject;
    popUpWin = PopUpManager.createPopUp(this, popUpWindow, true);
    Once component is displayed, how can i access using
    actionscript component's TextInput control (specifically its .text
    property) from my main .mxml file?
    thanks

    msabljic , sounds like you ran into the same problem as me,
    perhaps... I posted a question similar to yours around the same
    time. Take a look at the responses I got and maybe that will help
    answer your question.
    Here's a link to the post
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=60&catid=585&threadid =1285775&enterthread=y

  • How can I restore Parental Control Settings from Time Machine Backup?

    I was trying to adjust one of the parental controlled accounts for my child.  I disabled parental controls, rebooted, and re-enabled it.  Now all the settings that I had setup before are gone.  How can I restore Parental Control Settings from Time Machine Backup?

    Hi ...
    I've found a solution to my problem.
    Time Machine locates extenal HDD backups differently depending if they were done via a network or via a USB/FireWire/Thunderbolt connection.
    My initial backup was done via a direct Thunderbolt connection. I ran into the above issue b/c the second time when I tried looking for the backup file the HDD was conencted to my iMac and I was accessing it via a network conenction.
    I simply connected the drive directly to my MacBook pro and ... voila. I was able to see the backup, select the iPhoto library and begin the restore.
    Hope this helps.
    BTW - I found this out by reading the 'blue box' selection on this page: http://pondini.org/TM/E2.html
    (Thanks goes to Pondini!)

  • How To Access PAGE ITEM (single row) from HTML source

    Hi Guys,
    I have a page Item that return a string.
    I would like to show this string
    How To Access PAGE ITEM (single row) from HTML source?
    My desire final output is
    <marquee>:P1_PAGE_ITEM</marquee>
    Can please help me
    Thanks

    Hi,
    You can refer the page items in your page header as &itemname. For example, if I have page item P15_TEST, I will add the following in header:
    <marquee>
       &P15_TEST.
    </marquee>But make sure that you have a process before header to populate the value in your page item. Otherwise, there will be a null scrolling (which you can't see!) :)
    Regards,
    Zahid

  • Calling a component from a the main.mxml file

    How do I call a component from a the main.mxml file?
    <mx:Button id="btnNew" label="Launch Component " click="getComponent()" />
    main.mxml (Has the button, that I would like to launch getcomponent.mxml)
    getcomponent.mxml (The file I would like to call) (This file also has the ViewStack)
    For some reasoning it's not seeing the bpVS(view stack id). I'm getting Access of undefined property bpVS error.
    <!-- Main.mxml  -->
    <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
    xmlns:components="components.*"
    width="100%"
    height="100%"
    minHeight="0"
    backgroundAlpha="0">
    <mx:Script>
      <![CDATA[                    
       private function getComponent():void{
        bpVS.selectedIndex = 1;
      ]]>
    </mx:Script>
    <!-- GetComponent.mxml -->
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute"
    xmlns:view="components.view.*">
    <mx:ViewStack  id="bpVS"
      top="69" left="180.5"
      width="100%" height="100%"
      resizeEffect="Resize"
      moveEffect="Move" showEffect="Fade"
      hideEffect="Fade">
    </mx:ViewStack>
    <mx:VBox id="vbTB" top="69" verticalGap="0">
    <mx:ToggleButtonBar
        id="payTB"
        direction="vertical"
        dataProvider="{bpVS}"
        width="180" useHandCursor="true" buttonMode="true""
        resizeEffect="Resize"
        moveEffect="Move" showEffect="Fade" hideEffect="Fade" >
      </mx:ToggleButtonBar>
        </mx:VBox>
    Thank you

    It won't see it just by creating the namespace that contains it.  There has to actually be an instance of it in the application.  So in your case, your main application file (lets call it MyApp.mxml) would look something like this:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
         xmlns:components="components.*">
         <components:Main id="main"/>
         <components:GetComponent id="getComp"/>
    </mx:Application>
    Then, you can reach down (mind you this isn't best practice) into those components to access their public properties.  In a script block in MyApp.mxml, you could access the VBox with getComp.vbTB.
    I don't know the ins and outs of your application, but perhaps Main is the main application, so then you would add GetComponent as a child of it instead of both Main and GetComponent being child components of the MyApp application.  Does that clear up the confusion?

  • How can we delete the icloud accounts from main website.Iam trying to log in to my account and it says that MAXIMUM NUMBER OF FREE ACCOUNTS ARE ACTIVATED?What can i do guys plz tell me?

    How can we delete the icloud accounts from main website.Iam trying to log in to my account and it says that MAXIMUM NUMBER OF FREE ACCOUNTS ARE ACTIVATED?What can i do guys plz tell me?

    You can't delete an account, you can only stop using it.  If you're getting that error message you won't be able to create a new account on your device.  Your only options are to re-use one of the accounts previously created, or create a new account on a different iOS device or Mac (running OS X Lion or higher), if you have one.

  • How to read a tab seperated data from a text file using utl_file

    Hi,
    How to read a tab seperated data from a text file using utl_file...
    I know if we use UTL_FILE.get_line we can read the whole line...but i need to read the tab separated value separately.....
    Thanks in advance...
    Naveen

    Naveen Nishad wrote:
    How to read a tab seperated data from a text file using utl_file...
    I know if we use UTL_FILE.get_line we can read the whole line...but i need to read the tab separated value separately.....If it's a text file then UTL_FILE will only allow you to read it a line at a time. It is then up to you to split that string up (search for split string on this forum for methods) into it's individual components.
    If the text file contains a standard structure on each line, i.e. it is a fixed delimited structure, then you could use external tables to read the data instead.

  • Removing the Control Characters from a text file

    Hi,
    I am using the java.util.regex.* package to removing the control characters from a text file. I got below programming from the java.sun site.
    I am able to successfully compile the file and the when I try to run the file I got the error as
    ------------------------------------------------------------------------D:\Debi\datamigration>java Control
    Exception in thread "main" java.util.regex.PatternSyntaxException: Illegal repet
    ition
    {cntrl}
    at java.util.regex.Pattern.error(Pattern.java:1472)
    at java.util.regex.Pattern.closure(Pattern.java:2473)
    at java.util.regex.Pattern.sequence(Pattern.java:1597)
    at java.util.regex.Pattern.expr(Pattern.java:1489)
    at java.util.regex.Pattern.compile(Pattern.java:1257)
    at java.util.regex.Pattern.<init>(Pattern.java:1013)
    at java.util.regex.Pattern.compile(Pattern.java:760)
    at Control.main(Control.java:24)
    Please help me on this issue.
    Thanks&Regards
    Debi
    import java.util.regex.*;
    import java.io.*;
    public class Control {
    public static void main(String[] args)
    throws Exception {
    //Create a file object with the file name
    //in the argument:
    File fin = new File("fileName1");
    File fout = new File("fileName2");
    //Open and input and output stream
    FileInputStream fis =
    new FileInputStream(fin);
    FileOutputStream fos =
    new FileOutputStream(fout);
    BufferedReader in = new BufferedReader(
    new InputStreamReader(fis));
    BufferedWriter out = new BufferedWriter(
    new OutputStreamWriter(fos));
         // The pattern matches control characters
    Pattern p = Pattern.compile("{cntrl}");
    Matcher m = p.matcher("");
    String aLine = null;
    while((aLine = in.readLine()) != null) {
    m.reset(aLine);
    //Replaces control characters with an empty
    //string.
    String result = m.replaceAll("");
    out.write(result);
    out.newLine();
    in.close();
    out.close();

    Hi,
    I used the code below with the \p, but I didn't able to complie the file. It gave me an
    D:\Debi\datamigration>javac Control.java
    Control.java:24: illegal escape character
    Pattern p = Pattern.compile("\p{cntrl}");
    ^
    1 error
    Please help me on this issue.
    Thanks&Regards
    Debi
    // The pattern matches control characters
    Pattern p = Pattern.compile("\p{cntrl}");
    Matcher m = p.matcher("");
    String aLine = null;

  • Calling a function in main mxml  file from a component

    I have a main mxml file for an application.
    Within that file I have a viewStack with 3 components which
    are in separate mxml files.
    I have a function written in Action Script in the main
    application that I want to call from the 3 components.
    How is this done?
    Ta
    Mike

    Thanks for the help. I got it working using ntsiii's method
    (which is more straight forward but maybe not good practice?)
    though the line
    private var _appMain:Application = Application.application
    gave me the error message:
    1118: Implicit coercion of a value with static type Object to
    a possibly unrelated type mx.core:Application.
    So i changed it to:
    private var _appMain:* = Application.application
    Which made it work, I don't really understand why.
    Thanks
    Mike

  • How to read out message cycle time from Vector CANdb file?

    Hello LabVIEW friends,
    I tried to open a Vector CAN Database (*.dbc) using the NI-CAN 2.3.2 Channel API and read out the cycle time of a message.
    The CAN get property.vi should provide the sample rate which is described as followed:
    Input parameter of the CAN Init Start function.
    The sample rate specifies
    whether to transfer data in a periodic or event-driven manner.
    For periodic
    behavior, the rate specifies the number of read/write samples to perform per
    second.
    But for all messages in my database I get the value 0.
    When I connect a sample rate to the CAN Initialize.vi I will get it's value.
    Could anybody help?
    Thank You.
    Greets,
    Marcus

    Hi,
    unfortunately there is no way to use the cycle time property from your DBC file, because the NI driver is not able to read this information.
    This is because the cycletime is stored in different places for different users and only Vector itself can read this information back.
    In your case, you have to figure out this information by yourself and you can use the sample rate input of the init or initstart function to configure the cycle time in Hz.
    If you need different cycle times for different messages, see the attached example.
    DirkW
    Attachments:
    CAN_Multi-Chans_Diff-Period.vi ‏26 KB

  • Custom component calling function from main.mxml

    I have a main.mxml that has the following function in it:
    public function SubChooseField(evt:Event):void{
    Alert.show( "Sub has been chosen" );
    main.mxml also places the following custom component:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:ComboBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="180" close="parent.SubChooseField(event)">
    <mx:dataProvider>
    <mx:Object data="1" label="choice 1 />
    <mx:Object data="2" label="choice 2" />
    <mx:Object data="3" label="choice 3" />
    </mx:dataProvider>
    </mx:ComboBox>
    I want it so that when you chose one of the options in the
    comboBox, it will call the function SubChooseField in the
    main.mxml. But when I compile this, no matter what i try, i get the
    error:
    Error: Call to a possibly undefined method SubChooseField
    through a reference with static type my_custom_opponent.
    OR if i change the codeand remove the 'parent' to say:
    close="SubChooseField(event)"> i get error:
    Error: Call to a possibly undefined method SubChooseField.
    any help much appreciated.

    Rather than trying to use parent, using events might help
    here. In your main mxml file, just listen for the change event that
    is dispatched from your custom component. Since it is a ComboBox
    component, it automatically dispatches this event. If your
    component was more complex, you would need to dispatch a custom
    event.
    If your custom component was named CustomCombo, then the mxml
    in your main file would look something like this:
    <ns1:CustomCombo id="cb" x="70" y="39" width="160"
    change="SubChooseField(event)"/>
    Vygo

  • Passing a variable from an mxml component to the main mxml file

    Hey guys,
    I have a popup titlewindowt which is defined as a component in a separate mxml component file.
    In the popup window i have an inputbox and a button
    When i press the button in that popup window i want the text in the input box to be transfered across to a variable in my main mxml file
    How can i do this?
    Thanks
    Chris

    Since you are already tied in to the top level application then I would add a listener at the application level and in the component do a:
      FlexGlobals.topLevelApplication.dispatchEvent(....)
    However, I can't help but encourage you to decouple this functionality and pass events around rather than what you are currently doing.
    There are a few ways you can do this.  One is to use an MVC framework to model your application after.
    A simpler approach even would be to have the component simploy dispatch events to itself and have whatever is creating the component listen for the events and do higher level functionality.
    Good Luck!

  • How do i remove the exif metadata from my jpg file produced with a digital camera photo?

    How do i remove the exif metadata from my jpg file produced with a digital camera photo?

    The excellent and free utility Irfanview has the option to remove the EXIF data.
    Simply open and the file and do a Save, or Save As with the original name.
    Surprisingly, the default is to not keep the original EXIF data.

  • [svn:fx-trunk] 14083: Removed svn:executable property from some . xml files in trunk.

    Revision: 14083
    Revision: 14083
    Author:   [email protected]
    Date:     2010-02-09 22:48:11 -0800 (Tue, 09 Feb 2010)
    Log Message:
    Removed svn:executable property from some .xml files in trunk.
    QE notes: None
    Doc notes: None
    Bugs: None
    Reviewer: None
    Tests run: ant checkintests
    Is noteworthy for integration: No
    Property Changed:
        flex/sdk/trunk/modules/asc/src/java/macromedia/asc/parser/LiteralVectorNode.java
        flex/sdk/trunk/modules/asc/src/localized_strings/CS/ErrorConstants.xml
        flex/sdk/trunk/modules/asc/src/localized_strings/CS/Lint_Warnings.xml
        flex/sdk/trunk/modules/asc/src/localized_strings/NL/ErrorConstants.xml
        flex/sdk/trunk/modules/asc/src/localized_strings/NL/Lint_Warnings.xml
        flex/sdk/trunk/modules/asc/src/localized_strings/PL/ErrorConstants.xml
        flex/sdk/trunk/modules/asc/src/localized_strings/PL/Lint_Warnings.xml
        flex/sdk/trunk/modules/asc/src/localized_strings/PT/ErrorConstants.xml
        flex/sdk/trunk/modules/asc/src/localized_strings/PT/Lint_Warnings.xml
        flex/sdk/trunk/modules/asc/src/localized_strings/RU/ErrorConstants.xml
        flex/sdk/trunk/modules/asc/src/localized_strings/RU/Lint_Warnings.xml
        flex/sdk/trunk/modules/asc/src/localized_strings/SV/ErrorConstants.xml
        flex/sdk/trunk/modules/asc/src/localized_strings/SV/Lint_Warnings.xml
        flex/sdk/trunk/modules/asc/src/localized_strings/TR/ErrorConstants.xml
        flex/sdk/trunk/modules/asc/src/localized_strings/TR/Lint_Warnings.xml

  • Accessign webservice result from another mxml file

    HI,
    I have an mxml application that uses the <mx:webservice
    function to load a wsdl and get some values. I have tested the code
    and it works fine and i can get the result and fault methods
    correctly.
    I would now like to call this service from another mxml file
    and use access the result or fault string accordingly.
    example scenario would be that when i load my main page, i
    would like the lookup values obtained from using the webservice to
    be available.
    i tried the following but didnt get any luck. Here lookup is
    the mxml file which contains the webservice, which i am importing
    in this file. GetLookValuesWithAuth is the operation name.
    var l:lookup=new lookup;
    var s:AsyncToken=l.es.GetLookupValuesWithAuth.send();
    s.addResponder(new mx.rpc.Responder(onSResult,onSFault));
    public function onSResult(e:ResultEvent):void{
    Alert.show("value is");
    var xy:XMLList=XMLList(e.result);
    lplist=xy.descendants("LOOKUPVALUES");
    Alert.show("lookup is
    "+lplist.toXMLString()+xy.toXMLString());
    public function onSFault(e:FaultEvent):void
    Alert.show("Fault is "+e.toString());
    An example of the webservice call in lookup.mxml is shown
    below
    <mx:WebService id="e1" wsdl="{wsdl "
    result="resultHandler(event)"
    fault="mx.controls.Alert.show(event.fault.faultString.toString())>
    <mx:operation name="GetLookupValuesWithAuth"
    resultFormat="e4x">
    <mx:request>
    <databaseName>{database name}</databaseName>
    <userName>{username}</userName>
    <password>{password}</password>
    <lookupID>05855b98-75c7-4117-a91c-db59e9ea0204</lookupID>
    </mx:request>
    </mx:operation>
    Any suggestions?

    "amthekkel" <[email protected]> wrote in
    message
    news:g9ovt2$e63$[email protected]..
    > HI,
    > I have an mxml application that uses the
    <mx:webservice function to load a
    > wsdl and get some values. I have tested the code and it
    works fine and i
    > can
    > get the result and fault methods correctly.
    > I would now like to call this service from another mxml
    file and use
    > access
    > the result or fault string accordingly.
    > example scenario would be that when i load my main page,
    i would like the
    > lookup values obtained from using the webservice to be
    available.
    >
    > i tried the following but didnt get any luck. Here
    lookup is the mxml file
    > which contains the webservice, which i am importing in
    this file.
    > GetLookValuesWithAuth is the operation name.
    > {
    > var l:lookup=new lookup;
    > var s:AsyncToken=l.es.GetLookupValuesWithAuth.send();
    > s.addResponder(new
    mx.rpc.Responder(onSResult,onSFault));
    > }
    >
    > public function onSResult(e:ResultEvent):void{
    > Alert.show("value is");
    > var xy:XMLList=XMLList(e.result);
    > lplist=xy.descendants("LOOKUPVALUES");
    > Alert.show("lookup is
    "+lplist.toXMLString()+xy.toXMLString());
    > }
    >
    > public function onSFault(e:FaultEvent):void
    > {
    > Alert.show("Fault is "+e.toString());
    > }
    >
    > An example of the webservice call in lookup.mxml is
    shown below
    >
    > <mx:WebService id="e1" wsdl="{wsdl "
    result="resultHandler(event)"
    I have no idea about web services, but it seems to me you
    should have a
    closing curly bracket in the wdsl property.
    HTH;
    Amy

Maybe you are looking for

  • Remote access via pppoe - mac add limitation

    Hi, We have a requirement to provide remote access for a number of individual customers.  I plan on using pppoe for each of these customers as it will give us the ability to control each session individually and apply shaping etc if required. There w

  • CANNOT CHANGE PLANNING DATE

    HI GURUS, We posted a SD document 180000XXXX Base line date 16.12.2008 and Payt terms C003 (30 days) thE planning date must be 15.01.2009 but the Planning date is 12.01.2008. We intented change the base line date, the Payment terms and the Planning d

  • How to add logic in Bex designer?

    I have one formula field ZPERCENT in my query designer. ZPERCENT(%) = ZQTY / ZREVENUE. Now I want to add one logic in Bex deisgner, if ZQTY is equal to 0, then field ZPERCENT should be 100%. Does anyone have an idea how to make it possible in Bex des

  • EDI - Basic Message FIDCMT

    I hope someone can answer this before I get to deep into my research.  I was looking to use basic message FIDCMT to change an FI document?  Is that possible? Thanks,

  • Family Feud game won't load--says to clear browser cache--how do I do that?

    just as I said--I am trying to play Family Feud--it doesn't seem to want to load--says if continues to log out of Face Book and log back in tried that 2 times--also says to clear browser cache--I don't know how to clear browser cache--please give me