How to send a message between two custom components

I have a datagrid in a custom cuomponent that is.

< mx:Canvas id = "customerGrid".
Width = '100% '.
Height = "350" >
< customer: CustomerGrid / >
< / mx:Canvas >

< customer: CustomerDetail / >

The < customer: CustomerDetail / > has a TextInput. How to send a message to < customer: CustomerGrid / > to < customer: CustomerDetail / > when you click the datagrid control. When a user clicks the selectedItem I want this detail to display in the TextInput, which is in another component.

I'm looking in Restaurant Finder sample. He uses exactly as I wanted to do. However, it uses a kind of AccessibleText. Is there somewhat easier to implement.

Thank you

One way to do this is to use the property data, most of the components inherit and use links between the custom grid and the detail view.


Width = '100% '.
Height = "350" >

Now, in the light of the foregoing, I assumed that CustomerGrid is actually extending DataGrid, if this isn't the case, you will need to add additional logic to CustomerGrid. You will need to define a public property to the value of the selected item in the DataGrid inside the CustomerGrid and make it Bindable (see docs: metadata that can be related).

Inside the CustomerDetail, bind the TextInput property data, by setting the property in the data object to which you want to display.

Say the selectedItem (in the DataGrid) has a customerName field, you would do something like that (inside CustomerDetail).

Tags: Flex

Similar Questions

  • Communication between two custom components

    Hello

    I have a problem to get action in a custom component to cause a refresh of another custom component?

    My configuration is:

    < application >

    < component includeIn custom 1 "View1" >

    < component custom 2 id = "custom2" level = "{level}" "view2" includeIn >

    < component custom an includeIn 'View1' >

    < component includeIn custom B "view2" >

    < / application >

    I have a number of custom components load in my main application window.

    In the custom component 1, I have a drop down menu which determines levels 1 to 10.

    When the user chooses a new level, change an event is triggered and the dispathed to the main application that receives it in the UpdateDisplayHandler.

    Component event dispatcher custom 1:

    protected function level_changeHandler(event:IndexChangeEvent):Sub

    {

    var newDisplay:UpdateDisplay = new UpdateDisplay ("UpdateDisplay", level.selectedItem.value);

    dispatchEvent (newDisplay);

    }

    Main application manager:

    protected function updateDisplayHandler(event:UpdateDisplay):Sub

    {

    Level = event.level

    }

    Level information comes to the manager who updates the "level" variable correctly. So far so good.

    The variable "level" is can be linked and analyzed for the custom component 2.

    < components: custom2 id = level "custom2" = "{level}" / >

    The question is how to make my component custom 2 refresh(), reload() then it makes again based on new information of level?

    I will be grateful for any help on this matter.

    Karsten

    Is probably not the cleanest way, but he's going to move you quickly.

    public var levelNumber:int = new int;

    implement

    private var _levelNumber:int;

    public function get levelNumber (): int

    {

    Return _levelNumber;

    }

    public function set levelNumber(value:int):void

    {

    If (value! = _levelNumber)

    {

    _levelNumber = value;

    call the custom here update refresh method

    }

    }

    I don't know your usecase or your architecture so there are probably better ways.

    Maybe like this:

    The main application event handler:

    protectedfunction updateDisplayHandler(event:UpdateDisplay):void

    {//check if there is a change in level and exposes a public service on the part 2}

    If (level! = event.level)

    {

    Level = event.level;

    COMPONENT2.updateOrRefreshBasedOnNewLevelValue (Level);

    }

    }

    HTH,

    Claudiu

  • How to send and receive text messages between two simulators?

    I launched the first Simulator by inputing D:\Program Files\Eclipse\plugins\net.rim.eide.componentpack4.5.0_4.5.0.16 «»
    ents\simulator > 8300.bat/sms-source-port = 5000/sms-destination-port = 5001 "cmd

    tnen second Simulator by inputing E:\simulator>8300.bat/sms-source-port = 5001/sms-destination-port = 5000 in cmd

    but I can't not Simulator send and receive sms

    I assume that you have followed all of these steps?

    How - send SMS text messages between two BlackBerry Smartphone simulators

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800792/801083/How_To _...

    Can you elaborate on what does not work?  You see errors?  When missing to?

  • How to remove a path between two anchor points

    Hello

    everything is in the title,

    could you tell me please how to remove a path between two anchor points without using the tool Eraser path?

    When I select these two folders and press to remove all disappeared.

    PS: I want to keep the anchor after the removal

    Thank you

    with the Selection tool direct (white pointer), click the path segment (no points) or select slide above without going on something else and tap on delete.

  • How do I sync messages between active and reserve SE ACS

    Hello world

    I use two SE ACS (active and reserve).

    And I would like to synchronous messages on active and standby SE ACS,

    in other words, I would get messages on two of them are the same.

    Can I configure ACS SE to answer this?

    If the two SE ACS can have same recorded messages, how can I configure ACS SE?

    ACS SE version is version 4.1 Build 23 Patch 1 (1).

    Your information would be appreciated.

    Best regards

    Hello

    On ACS SE you can not send logs to an another ACS.

    4.1 allows you to send syslogs and newspapers to Remote Agents.

    Kind regards

    Vivek

  • How to give a delay between two Boolean?

    Hi all

    I want to insert a dalay in time between two Boolean values. My requirement is I want the second boolean to be switched on after delay 2 sec of variable Boolean 1 is turned on.

    How to do?

    Thank you

    Yes, I don't want to do antthing...

    Meanwhile, I also had the same idea...

    Thanks for the reply

  • DROID: Stupid Question perhaps? How to send text messages?

    This may sound stupid, but for the life of me, I can't understand how to send a test message... any ideas?

    go to the text message you want to transfer.  tap and hold.  a menu will appear and select forward.

    If the message in a thread, press the text message you want to forward.  It should only send this message in the thread.

  • How to send a message to another computer by using prompt on a network in Windows 7?

    Original title: How do I send the message

    How to send message to pc network using the prompt for windows 7

    Hello

    If you want to put some small insatlling time program on computers.

    This free utility. makes it easier for any qualified users to send messages via LAN.

    http://www.Fomine.com/net-send-GUI.html

    Jack-MVP Windows Networking. WWW.EZLAN.NET

  • How to send a message to users

    I recently received a message by the developers of one of the apps that I use. He said something like "heres informing you of a new great application" etc.

    I was curious as to how I got this message, and how to do about sending such a message to users who have downloaded my theme? Basically, how to communicate with my users?

    There is no direct way to communicate to the users since you don't really know who they are. You could:
    (1) create a blog
    (2) the XML on a server configuration the application checks on a regular basis. The XML can contain messages with dates.
    (3) push installation notification

  • How to send a contact to two different program step

    Hello

    I have a program where I need to send a contact to two paths different program (series of steps and conditions).

    If condition "product = A" is true then go to step 100 (101,2,3) and 200 (201,2,3)

    Otherwise, go to step 200 (201,2,3)

    Please let me how can know I do this?

    Thank you

    Rama

    A contact can only be once in a program, there are 2 options here.

    (1) you can have flow path for steps 100, 101, 102, 103, etc and then at the end of this journey, send them to step 200 and pass them around this way here.

    (2) divide these 2 channels into 2 programs. Before step 100, you can add a step to 'Add program' (check that you do not move to the program, which will remove them from the current program), and have steps 200, 201, etc in a post-secondary program. In this way they can scale down the two paths at the same time, since its 2 different programs.

  • How to center the object between two guides (or a guide to the edge of the artboard)

    Simple question: How can I Center an object between two guides or between a fence and the edge of the artboard?

    Chris,

    You can (guides are your friends):

    (1) create a rectangle between two Guides or between the fence and the edge of the artboard by ClickDragging with the Rectangle (desired penalty) tool on a (location) on the other Smart Guides say path/path or page/path when you're there;

    (2) select the two rectangle of 1) and the object, and then click the rectangle, and then use the options in the align palette.

    Who should move your object in the Center in the direction you choose.

  • How to return all dates between two dates?

    Hi all

    I need get all dates between two dates, Oracle SQL and PL/SQL.

    for example
    01/10/2011 - date 1
    10/11/2011 - date 2
    
    # Return Values
    01/10/2011
    10/02/2011
    03/10/2011
    .
    .
    .
    09/11/2011
    10/11/2011
    How can I get these values? Any help will be useful.

    Thank you

    Maybe

    select :start_date + level - 1 the_date
      from dual
    connect by level <= :end_date - :start_date + 1
    

    Concerning

    Etbin

  • How to find a number between two numbers?

    I try to find the numbers between two given user numbers and multiply each of them, but my code so far wont allow me to separate the numbers multiply:

    ex: the numbers are 5 and 10: my code gives me 5678910 together online.

    How can I sneek the * between these numbers? I know that I am seriously close here's my work so far.

    Any help is greatly appreciated.


    import java.util.Scanner;

    public class FindIt
    {
    Public Shared Sub main (string args [])
    {
    Console scanner = new Scanner (System.in);

    int userNumber, finIn, finIn2, finIn3;

    System.out.Print ("enter a lower limit > = 1 :"); ")


    do
    {

    userNumber = console.nextInt ();

    If (< 1 userNumber)
    {
    System.out.Print ("enter a lower limit > = 1 :"); ")
    }

    } while (< 1 userNumber);

    System.out.println ("the lower limit is" + userNumber);
    System.out.println ();
    System.out.Print ("enter an upper limit > = 3 :"); ")
    finIn = userNumber;
    do
    {

    userNumber = console.nextInt ();

    If (userNumber < 3)
    {
    System.out.Print ("enter an upper limit > = 3 :"); ")
    }

    } While userNumber < 3.

    System.out.println ("the upper limit is" + userNumber);
    System.out.println ();
    finIn2 = userNumber;



    int x, y;
    y = 0;
    for (x = finIn; x < = finIn2; x ++)

    CallIncr();





    }
    }

    Published by: 806590 on October 31, 2010 13:07

    Published by: 806590 on October 31, 2010 13:09

    Modified the code of the loop to as below

    for (x = finIn + 1; x)< finin2;="">

  • You can pass a bitmap between two custom classes?

    I have two custom as3, TriviaGame and TriviaQuestion classes, and I try to retrieve a bitmap stored in TriviaQuestion and have found it impossible to date.

    It seems that the root of my problem, is that this bitmap is somehow void in my GetImage function, even if it is class that has been defined previously in ImageLoaded() data. The only time where I am able to access the information of the bitmap (in order to add it to the display) is inside ImageLoaded().

    In TriviaQuestion.as, loading the image:

    private function XMLLoadedHandler (e:Event):void
            {
                xml = new XML(e.target.data);
                
                // grab title
                titleFormat = new TextFormat( font, 25, color, true, null, null, null, null, "center" );
                titleText = CreateText( xml[0].attribute("title"), titleFormat, (stageProps.stageWidth/2), (0 + margins), (stageProps.stageWidth) );
                
                // get questions/answers
                var qList:XMLList = xml.item;
                totalQuestions = qList.length();
                questions = new Array();
                
                for ( var i:int = 0; i < totalQuestions; i++ )
                {
                    var myItem:XML = xml.item[i];
                    var temp:TriviaQuestion = new TriviaQuestion();
                    
                    // set question class data
                    temp.SetQuestion( myItem.question );
                    if ( "image" in myItem )
                    {
                        temp.SetImageProps( myItem.image, myItem.image.attribute("position") );
                    }
                    var answers:XMLList = myItem.answer;
                    temp.SetAnswers( answers );
                    temp.SetHint( myItem.hint, xml[0].attribute("ptsPerHint") );
                    temp.SetFact( myItem.fact );
                    temp.SetPotentialPoints( xml[0].attribute("ptsPerQuestion") );
                    
                    questions[i] = temp;
                }
                
                AssembleQuestion();
            }
    

    In TriviaQuestion.as, set the class data:

    public function SetImageProps( url:String, attr:String ):void
             {
                imgLoader = new Loader;
                imgLoader.contentLoaderInfo.addEventListener( Event.COMPLETE, ImageLoaded, false, 0, true );
                imgLoader.load( new URLRequest( url ) );
                
                position = attr;
            }
            
            public function ImageLoaded(e:Event):void
            {
                bitmap = LoaderInfo(e.target).content as Bitmap;
            }
    
    

    In TriviaGame.as MakeQuestionSprite()

    private function MakeQuestionSprite( s:Shape ):void
             {
                if ( "image" in xml.item[currentQuestion] )
                {
                    var myPos:String = questions[currentQuestion].GetPosition();
                    var myImg:Bitmap = questions[currentQuestion].GetImage();
                    errorText.text = "Img: " + myImg.width;
                }
                var myQ:String = questions[currentQuestion].GetQuestion();
                questionText = new TextField();
                questionFormat = new TextFormat( font, 15, color, null, null, null, null, null, "center" );
                
                if ( "image" in xml.item[currentQuestion] )
                {
                    if ( myPos == "right" )
                    {
                        myImg.x = stageProps.stageWidth - margins - myImg.width;
                        //myImg.y = margins + s.y + (s.height / 2);
                        //myImg.visible = true;
                        //questionText = CreateText( myQ, questionFormat, margins, myImg.y, (stageProps.stageWidth - margins - myImg.width) );
                    }
                    //questionSprite.addChild( myImg );
                }
                else
                {
                    questionText = CreateText( myQ, questionFormat, margins, (margins + s.y + s.height / 2), (stageProps.stageWidth - margins) );
                }
                
                questionSprite.addChild( questionText ); 
            }
    
    
    

    In TriviaQuestion.as, GetImage

    public function GetImage ():Bitmap
             {
                var copy:Bitmap = new Bitmap( bitmap.bitmapData.clone() );
                return copy;
            }
    
    

    You could try to copy your bitmap image until it's ready. When I did this test he kept fail with the same messages that you receive, even after a different syntax in many trials. But when I split the TriviaQuestion test class and added an event listener (see the text in bold below) for once the charger has been filled, then I was able to recover the new bitmap. My two examples classes are based on your examples:

    TriviaGame

    package {}
    import flash.display.Sprite;
    Import TriviaQuestion;
    Import 12345678910111213import;
    import flash.display.BitmapData;
    import flash.display.DisplayObject;
    import flash.display.Loader;
    import flash.events.Event;

    SerializableAttribute public class TriviaGame extends Sprite {}

    questions of private var: Array;
    private var q1:TriviaQuestion;

    public void TriviaGame() {}
    issues = new Array();
    Q1 = new TriviaQuestion();
    questions.push (Q1);

    MakeQuestionSprite();
    }

    private void MakeQuestionSprite (): void {}
               var myTriviaQuestion:TriviaQuestion = issues [0];
    myTriviaQuestion.addEventListener ("Ready", addNewBitmap);

    this.addChild (myTriviaQuestion);
    }

    private void addNewBitmap(e:Event):void {}
    var mybitmap:Bitmap = issues [0]. GetImage ();
    MyBitmap.x = 400;
    this.addChild (mybitmap);

    }

    } / / end of class
    }

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

    TriviaQuestion

    package {}
    Import 12345678910111213import;
    import flash.display.Loader;
    import flash.events.Event;
    import flash.net.URLRequest;
    import flash.display.LoaderInfo;
    import flash.display.Sprite;
    import flash.display.BitmapData;
       
    SerializableAttribute public class TriviaQuestion extends Sprite {}
       
    private var imgLoader:Loader;
    public var bitmap2:Bitmap;
    private var position: String;
    private var _copy:Bitmap;
       
    public void TriviaQuestion() {}
    SetImageProps ("frog4.jpg");
    }
       
    public void SetImageProps (url: String, attr:String = "" "): void
    {
    imgLoader = new loader;
    imgLoader.contentLoaderInfo.addEventListener (Event.COMPLETE, ImageLoaded, false, 0, true);
    imgLoader.load (new URLRequest (url));
           
    position = attr;

    }
           
    public void ImageLoaded(e:Event):void
    {
    bitmap2 = new bitmap;
    bitmap2 = Bitmap (e.target.loader.content);
    addFrog();
              this.dispatchEvent (new Event ("Ready"));
    }

    public function addFrog (): void {}
    this.addChild (bitmap2);

    var frog: Bitmap = GetImage ();
    Frog.x = 200;
    this.addChild (frog);
    }
           
    public function getBitmapData (): BitmapData {}
    Return bitmap2.bitmapData.clone ();
    }

    public function getLoader (): {charger
    Return imgLoader;
    }

    public void GetImage (): Bitmap
    {
    var copy: Bitmap = new Bitmap (bitmap2.bitmapData.clone ());
    return the copy;
    }

    } //end of class
    }

    Post edited by: waterlovinguy

  • How to create a relationship between two blocks

    Oracle forms 6i
    Hai All

    I've created a form that I have four button ADD, QUERY, SAVE, EXIT.

    I have two block named head and members.

    Four Chief areas namely block unitid, deptcode, codeno name.

    When I pressed the query button, and the cursor goes to the Chief name field when I enter the name of the leader and click

    Enter I give the codeno, the deptcode and the unitid of the leader_name.

    so now, I created another block in a tabular structure to bring members in the same deptcode that belongs to Leader_name.

    So pls tell me the steps how to create the relationship between these two blocks.


    When I enter the leader_name and gives enter need to bring the codeno, the deptcode, the unitid and

    I also need to give the members of this deptcode...


    Thanks in advance

    Srikkanth.M

    To write, only State a selection:

     :blk2.item = :blk1.item
    

    François

Maybe you are looking for

  • Put the current sim in unlocked iPhone

    Hello I currently have an iPhone 5 c locked to the O2 on a 24 month contract. I recently bought an iPhone 6 directly from Apple, that is to say unlocked and have ordered a contract monthly only sim which will arrive later this week. My question is, I

  • Low volume of bike G microphone

    Hi all bought a G bike for my wife a month ago. All good, but a week ago she noticed, in an appeal, that the receiver has not been heard. After that, same happened to each call. In fact, she's heard, but very weak. She can hear the other person well.

  • Windows Vista will not start up - keep getting the black screen

    I read through the questions answered similar questions and still can not past the black screen with windows vista.  It's on a dell inspiron 1525.  Also, it does not start in safe mode and I tried booting from the last good configuration and is still

  • driver for usb vid_0403 & pid_6001 & rev_0400 windows 7

    Hello, please I need for windows7 drifer for "usb vid_0403 & pid_6001 & rev_0400. Thank you

  • New on this kind

    OK, I have an Eee PC Seashell series and I did a scan, nd he says a bunch of pilots were out dated or missing, im disabled don ' t have a lot of money to work with and to top it all im really a beginner at this and that u see not good at spelling lol