Component / sender

Hello
I was wondering if someone could give me some advice on a simple problem I muddle through.
It's basically to do with communication between the components and the parent app.

The problem is that there are a variable number of the same component being added to the app and I can't work out how to target them. I'm adding them on click of a button like this:

var newBox:textItem = new textItem;
someContainer.addChild (newBox);
newBox.addEventListener ("login", loginHandler);

The textItem component dispatches an event when it is selected

var e:LoginEvent = new LoginEvent ("login", myIdName,);
dispatchEvent (e);

All the stuff of dispatching works very well, I send you 'myIdName' back in there because in the main application, I try to know which instance of the component is accountable. I don't know that this is not the way!

In any case, after that I got the name of the component as a string, I can't work how put Flex to use it to target the component - how can I change it from a string to something that I can use as a component id?

I guess, basically, the main points are;
1. do you assign a code when you addChild()?
2. how to find the ID of the and target dynamically added components?

Thanks a lot for all the help everyone

extend the LoginEvent class to add the new property of type UIComponent, add this constructor while construcitng LoginEvent instance add the reference "thie" reference:

var e:LoginEvent = new LoginEvent ("login", myIdName, this);

in fact, you can get rid of the second parameter like cast 'this' type of the component as you acceding to all its properties, including the property 'name '.

ATTA

Tags: Flex

Similar Questions

  • How a component can call the right target

    Hello, I have a request primarily to view the data in the datagrid control. one of the button can open a swfloader to bring an element of data entry. After the entry, simply click Save button and it will be closed. I perform the shutdown button to call an Application.application.clean () to close the swfloader. It has worked well.
    Now I need to go this app as an application under a main app after the opening of the data entry, I can no longer uss save to close the swfloader. Obviously the Application.application is now point of main application. How can I call the public function of secondary app in this way. (I tried with parentApplication into the SWF to data entry and find that the parentApplication sucks, so I got the error message saying cannot reference to a property or method of a null object)
    Thank you

    A better way to proceed would be to have the component send event propagation and listen for this event where you need to deal with.

    Tracy

  • Difference between SQL and PL/SQL

    Hello

    Wrong if I say:
    SQL only access the database (under the hood)
    PL/SQL is a layer on top of SQL.

    Correct me if I'm wrong

    Thank you

    user12045475 wrote:

    Try to understand, it is true what I write below?

    What exactly is BC ? Cache buffers?

    SQL:
    Select *...
    data-online BC-online client memory file

    All SQL are analyzed as a SQL cursors. A handful of customer for this SQL cursor is returned to the caller. In the APIs such as ODBC, it is a statement handle. In PL/SQL, this is called a variable from PL/SQL cursor for example.

    The client now called the interface extraction (using this handle) for this SQL cursor. The data moves from the (buffer cache/LMS) database to the client variables that will receive this output cursor.

    If the client is remote, the data moves over TCP. If the client is local, that data travels via IPC (since the process of the Oracle server to the client process).

    If this customer is the PL/SQL, the data moves from area (SGA) memory to another (PGA) within the same server process. This is the fundamental reason why PL/SQL will always be better than other clients as the travel itinerary data from the SQL cursor for the client variables/extraction buffer is very short.

    Insert * select
    data-online BC-online data file file

    Same process as above. Only, the customer data from the database. It retrieves data from a table and inserts the data into another table - in the same cursor. The SELECTION of this slider component sends not all selected customer lines.

    This highlights a fundamental approach to Oracle called SQL maximize and minimize the PL/SQLdevelopment.

    The SELECT could be done via a dedicated slider. With the client by pulling all lines so that the database in the memory of the client. So, the INSERT could be done (also a dedicated slider) and the same data that is pushed back to the database.

    So for this approach, data will be make to the customer, then from the client to the database database. It's quite a detour for travel. The same same thing could be done using a simple SQL cursor (as opposed to two dedicated sliders). And this slider could make reading and writing lines, without sending the data via a detour through the memory of the client.

    The underlying concept is to optimize the use of SQL - solve both the problem of data processing in SQL itself. And if it is not really feasible using only SQL, then consider using the PL/SQL.

    PL/SQL:
    Select * in...
    data file => BC-online PGA? -online client memory

    See the answer in the upper part of the 1st sample you posted. This is no different. A SQL cursor is created (called a PL/SQL implicit cursor). The output of this slider is extracted and stored in local client variables (which reside in the PGA for PL/SQL code).

  • Urgent: ActivePrincipalNotFoundException: no active group found GroupPrincipalId: 7D6E682A - 54 c

    Hello
    I'm administer and maintainng an application based on LiveCycle'RE 8.0.  I recently received the exception described in the title of the post.
    List of users of the application is synchronized with ldap for my client and consists of a workflow to digitally sign pdf files. Once the first user has signed the file an email is sent to the next user.
    The component sending email is a custom component developed by my company, as the last step it uses the e-mail address of the user to the following address to query the database of adobe and translate it into a unique identifier (select id from EDCPRINCIPALENTITY where email =?) and return the result in 'UserUID', defined as the component output variable. The component output variable is mapped to a process variable (UserID) and a route brings the process to a UserService (trust).
    Now, for a user specific id gets resolved and return to the UserService, but of the UserService wedge with the below exception (if you need full battery I can provide):
    2011-01-31 17:17:34, 017 INFO [STDOUT] 31 January 2011 17:17:34 com.adobe.idp.taskmanager.dsc.userservice.UserServiceImpl createTaskFromDialogProperties
    WARNING: UserServiceImpl:createTaskFromDialogProperties() that no active principle was found trying to create the task, this point will be block or showing a tire defect.   Exception message is: no active group found GroupPrincipalId: 7D6E682A-54C0-FD98-8BBF-A80ED367A8BC
    com.adobe.idp.taskmanager.dsc.client.task.ActivePrincipalNotFoundException: no active group found GroupPrincipalId: 7D6E682A-54C0-FD98-8BBF-A80ED367A8BC
    ...
    2011-01-31 17:17:34, 019 INFO [STDOUT] 31 January 2011 17:17:34 com.adobe.idp.taskmanager.dsc.userservice.UserServiceImpl createTaskFromDialogProperties
    WARNING: UserServiceImpl:createTaskFromDialogProperties() an exception has occurred trying to create a task, and the exception is not related to the assignment to an invalid user.   Exception message is: no active group found GroupPrincipalId: 7D6E682A-54C0-FD98-8BBF-A80ED367A8BC
    com.adobe.idp.taskmanager.dsc.client.task.ActivePrincipalNotFoundException: no active group found GroupPrincipalId: 7D6E682A-54C0-FD98-8BBF-A80ED367A8BC
    at com.adobe.idp.taskmanager.dsc.service.TaskManagerServiceImpl.getQueueForPathExpression (your skManagerServiceImpl.java:5807)
    This seems to happen only for this user and this kind of document. I checked that the configuration of users and groups and everithing seems fine. There is no inactive services and as we have already said, at the moment, this seems to happen all for this user.
    Also I tried to retray the task to a standstill and happened (as if the user had signed the document) but then I have anther error:
    2011-02-01 11:08:36, 971 ERROR [com.adobe.workflow.AWS] action-instance of stall: 112318 with message: ALC-DSC-002-000: com.adobe.idp.dsc.RequiredParameterException: parameter: document is required.
    What exactly does the first exception? What can I check to fix this?
    I need emergency aid, for at least this user is stuck.
    Thanks in advance

    Interesting idea.  If that's the case then you should be able to add a control to your SQL query to make sure that you use the current record.

    and status = 'CURRENT' can suffice.

  • Newbie question (DispatchEvent can't main Application)

    Hello world

    I am trying to send an event from a component mxml (CompB) to interact with one another mxml component (CompA), and they both live on the Application (addChild) of the hand, but it does not seem to have reached the main Application.

    There is no mistakes or tricks...

    I think it could be a syntax error.

    Any direction would be greatly appreciated!

    Here is my code... (condensed to only show what is necessary)

    CompB:

    " < = xmlns:mx mx:Panel ' http://www.Adobe.com/2006/MXML "

    creationComplete = "creationCompleteHandler ()" >

    < mx:Script >

    <! [CDATA]

    private function creationCompleteHandler (): void {}

    videoDisplay.addEventListener (VideoEvent.COMPLETE, videoCompleteHandler);

    }

    public void videoCompleteHandler(event:VideoEvent):void {}

    dispatchEvent (new Event ('videoComplete'));

    }

    []] >

    < / mx:Script >

    < / mx:Panel >

    ------------------------------------------------------------------------------------------ -----

    Main application:

    " < = xmlns:mx mx:Application ' http://www.Adobe.com/2006/MXML "

    Initialize = "init ()" >

    < mx:Script >

    <! [CDATA]

    import com.CompA;

    import com.CompB;

    private var myFancyCompA:CompA;

    private var myFancyCompB:CompB

    private function init (): void {}

    myFancyCompB.addEventListener ('videoComplete', completeHandler);

    addChild (myFancyCompB);

    }

    public void completeHandler(event:Event):void {}

    Alert.Show ("Success!");

    myFancyCompB.visible = false;

    }

    []] >

    < / mx:Script >

    < / mx:Application >

    When I run the application, and the video ends, no popup alert...

    I narrowed down it to the expedition or the listener.

    I feel that the event is not that they prepare properly.

    Thank you!!

    DK

    Your event dispatching component sends the event at the top of the hierarchy of the application.  If the parent is the application he will hear it.  If your component is buried a little further down bubbling (set to true) allows him to go up the hierarchy until you reach the next level.  You can stop it bubbling in some points using stopPropogation() or stopImmediatePropogation().

    However, can I still add to thid question HarUI, or someone else and ask why bubbles considered bad practice.  I've seen other applications do.  If you want to send an event at two levels, so to speak, you listen to so and re ship at each level.

    What is the best practice for this?

    Thank you very much.

  • Need help with components! PLEASE, I BEG YOU!

    Hello

    First of all, I want to thank you all for taking your time to read my post, and also give me time to answer if you can.

    I was stuck with this component for a little while now. I was wondering if anyone knew how to make a list component send me in the right frame?

    I know with certainty that in the settings section if I change the data component and put another site, that he will send me directly to a Web site. However, I was playing with it and I was try and search on Google and I can't find a way to do that when I click an option from the list I created, to send me a picture I want.

    that is, if I click on option 4 in my list I want that he send me to frame "contact us" for example.

    How can I do this? Do I need a lot of Actionscript?

    I appreciate your help and your review.

    Really yours.

    Agustin Gutierrez
    Carleton University
    Baccalaureate biomedical and electrical engineering. (III)
    Webmaster - Biomedical Engineering Society (bmed.engsoc.net)
    Webmaster - control Automatizacion Ingeniería y Comunicaciones S.A. de C.V. (www.iaccpue.com)
    Webmaster - Russell Heights Community House (www.russellheights.ca)

    Oh nevermind...

    the code to change the list item is the following...

    list_box.change = {function (evt,:Object)}
    myVar = list_box.selectedItem.data;
    getURL (myVar, "_blank"); change this to do what you want
    };
    list_box.addEventListener ('change', list_box)

    Thanks again to all

  • Error: Select a valid value

    Hello

    We have a custom Page of the sender, in this page, we have a lov component sender element. lov for this element is external lov. Selecting some elements of the sender in lov and when clicking on apply, the few lines it show the error 'select the valid value. Can anyone help, how do I solve this problem?

    Thank you and best regards,
    Fitted

    Hi khadija;

    Select a valid value error refer

    --
    GsrC

  • Status window component-fax fax Windows does not appear when sending or receiving

    I can send and receive faxes using Microsoft fax in windows component, but fax status window does not appear when sending or receiving.  How can I fix?

    Assuming that long ago, that you have installed Service Pack 1 for Windows XP, your problem may be a badly configured third-party firewall.  See http://service1.symantec.com/SUPPORT/nip.nsf/4a29389c214c78ea88256c75005f451a/713afacbd4135e0a88256c77007e526f?OpenDocument

    Also take a look in the event viewer (start > run > eventvwr > OK) for errors or warnings related to the fax system.  If you find one, double-click on it to open the event properties, and click on 2 pages below the up/down arrow icon to copy the events to the Clipboard.  Then paste it in your response.

  • can send us the data by component/container pop?

    Hello! Everyone!

    I have a question about sending data. I've implemented a componet that generate pop-ups. but I have to send data from popup to display the message of the relationship with this component. so, my request is that is there any method that send data to pop up? is yes then give the answer. I am very grateful...

    Thank you

    Add a random method to the pop-up window, (for example, dataMethod(data:String):void is the method)

    whenever you create a popup, you will always have the reference of the popup still with you (say "reference") (see popupmanager of static methods for this), use the reference and the method the earlier created to send data like this (reference.dataMethod ("hello"))

  • HOW TO SEND AN 'OUT' EVENT TO A COMPONENT?

    I am writing an AIR application that has many components.  The main application has a "start" button to start a new project, and when you leave a project, the application returns to the start page.  Even if you exit back to the start page, the main MXML components used in the application are not destroyed, because there is no way to destroy them that they just rest here idle in the background and not visible in the State of 'start '.  The problem is that, when a user clicks on the "start" button to start a new project, the MXML components appear in the new project in the former State that they were in because there is no obvious way to reset.  If there was a way to destroy the components, and then when they were recreated in a new project I could initialize with a creationComplete handler.  But since you can't literally destroy a component MXML, I need a way for components to be able to listen to the main program for a click on the button 'Start' event, and then each component to initialize itself when he hears the event.  So I need instead of components passes an event up to the main application, the main application to send an event down to the components.  Is there a way to send an event to the main application on various components?  (or is there a way to destroy a MXML component so that you can recreate later I don't know of?)

    Yes, that will do the job, but it is preferable to use a custom event and you need not a property.

    I quickly did a small example in Flash using a static variable as a plate rotating Central shipped...

    Create a class:

    package {}

    import flash.events.EventDispatcher;

    SerializableAttribute public class EventHub extends EventDispatcher {}

    public static var Dispatcher: EventHub = new EventHub();

    public void EventHub() {}

    the constructor code

    }

    }

    }

    in the pane to add this

    EventHub.dispatcher.addEventListener ("INIT_COMPONENT", _onInitComponent);

    the Manager of the event within your component

    private void _onInitComponent(e:Event):void {}

    trace ("received INIT_COMPONENT");

    }

    everywhere where you have trigger init, add this

    EventHub.dispatcher.dispatchEvent (new Event ("INIT_COMPONENT"));

    Paul

  • Sending data from one component to another

    I want to send data from one component to another.

    Both are on the page of Main.mxml

    What is the best way to do it (without going into a frame)

    Who send data up to the main.msml via an event then complex treatment of vars public and pick up in the second pane, but is it possible to go straight?

    Thank you

    Dan

    Once the element keeps one reference to another. Or you set it to a global var shared by two components.

    C

  • Send the component behind the other

    Hello, I am currently playing on the sample application BestCamera community, and I was wondering if I could have a component showing in front of the camera. Currently, I am unable to do this, and I find myself with just the willingness to display camera any of my buttons and other items showing. Thank you

    This is probably because the z-order is not defined, look in the docs here and scroll down just a bit, there is an explanation for it. In short, if the z-order is a positive number, the ForeignWindowController is on the main screen, set a negative value would your main screen overlap the ForeignWindowController from my understanding. You also code snippets show how to set the z-order in C++.
    https://developer.BlackBerry.com/native/reference/Cascades/bb__cascades__foreignwindowcontrol.html

    You can also see the same code in the sample application HelloForeignWindow
    https://github.com/BlackBerry/Cascades-samples/tree/master/helloforeignwindow

  • Send the property in the component definition

    I have an object attached with a webview on my page qml

    attachedObjects:]

    {ComponentDefinition}

    ID: statPortalDef

    {Page}

    string urlString property

    WebView {}

    ID: webView

    URL: urlString

    }

    }

    }

    ]

    I'm trying to create and define this webview url with the following

    statPopUp = statPortalDef.createObject)

    activePane.push (statPopUp)

    statPopUp.urlString = ""http://google.com " "

    But set the urlString always breaks the code. Does anyone have advice on how I can accomplish sending my url in the attached webview?

    try to add "var" in front of statPopup to make a local variable that is accessible.

  • Easiest way to send an event from a custom component

    Hello
    I have a custom login form, and I would like to create an event that is raised when the authentication returns true from the server. Right now I have a result event in the component to handle the Boolean condition of webservice. I tried simply instantiating a new event (public var auth:Event = new Event () ;) inside the element and the distribution of this event of the logic of the Manager resultEvent. But, outside the element, not no symbol bit next to the auth event lightning bolt as appropriate to call an event from the mxml.

    I want to be able to instantiate this event since the mxml listener and manage the event from outside the custom component. Should which model I use to encapsulate the event?

    Thank you
    JED

    Amy Blankenship was very helpful with his post to:
    http://flexdiary.blogspot.com/2007/08/dispatching-events.html

    Handycam was also OK, but missed me the key I needed.

    And would work on the idea of Greg, but I wanted to encapsulate the event so that the handler in myComponent.parent could be instantiated in this component.

    Here's what I ended up doing:

    in the mxml component


    [Event (name = "authenticated", type = "flash.events.Event")]

    The logic of management in the method

    private void testValidation(event:ResultEvent):void
    {if(event.result == true) dispatchEvent (new Event ("authenticated")) ;}}

    in the main application

    When you use the meaning of code in Flex Builder, "authenticated" came as a selection of events valid.

    Thanks again everyone,
    JED

  • I can't send an email to 'write', no send button, no menus

    I replied to a message when the open screen I saw not the formatting toolbar.
    I tried to understand why by looking at the drop-down view menu, but it was not shown.
    I thought to disable a component of the view at a time to see if it is there somewhere, but after unchecking all the toolbars I still does not see the formatting toolbar.

    This is the toolbar that I see if I select new message. Contains a photo smilely and insert icon and the selection of text fonts and size.

    I can not yet send the message because I don't see no send button

    The ALT trick is a shortcut for Microsoft. It's anyones guess how this will work on different systems. On mine I press and release and the toolbar appears and remains. To have all the time display, go to view-toolbars and click on.

Maybe you are looking for