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

Tags: Flex

Similar Questions

  • 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).

  • I want to create communication between two laptops by Bluetooth series

    Hello

    I'm trying to accomplish communication series between two laptops via a Bluetooth connection.

    The two laptops are NOT portable Toshiba, but they work together the Toshiba Bluetooth Stack For Windows. They have both also use the default Bluetooth Manager program supplied by Toshiba and Dell (just rebadged?).

    Basically I can set up a connection no problem, but then I have never send data serially from one computer and watch the receiver serial port on another computer but nothing happens.

    Is there a good tutorials for this? It would be nice to have something for the Toshiba Bluetooth Manager especially windows and buttons have names as explained in the tutorial.

    Thanks in advance.

    Adam

    I tried via a hyperterminal connection for testing purposes and it worked.
    Maybe the description also contains useful information for you.
    It is here:

    PC1:
    Start "Bluetooth settings-> Mode custom-> Select Remote PC-> Select"Serial Port"-> Accept proposed (in my case COM40) COM-> Confirm Assistant windows port
    until the installation is completed".

    PC2:
    Start 'HyperTerminal-> Select COM7.

    PC1:
    Start 'HyperTerminal-> Select COM40 (in my case. (See step 1 above) »

    PC1, PC2:
    Enter the password even if security is enabled for example "0000".

    PC1:
    Everything you type in HyperTerminal must be visible in HyperTerminal of PC2 and vice versa.

  • GPIB communication between two computers

    I try to communicate between two computers via GPIB. A computer to send an order, the other will receive, save and then respond accordingly. This response will then be received by the first computer and displays (this is the emulation of a device, the real need is to communicate with a satellite TT & C)

    I realized all of this. However, to be in listening mode I wired a property node with a timeout-infinity (1) before reading. Now I can't leave the VI as he is still stuck in playback until the receipt of an order.

    How can I get out of the VI when he's stuck in playback function.

    PS: Using GPIB for communication is a requiremnet of ht eproect and cannot be replaced.

    Hello

    You can have the timeout of read and then clear the error and keep looping until you get a message.  And then you can use arithmetic consisting of stop the loop if you click on the stop button, or get one error other than a timeout, or if playback returns data.

    If it works for you?  I joined your 'writing and then read.vi' with the added code.  Double check my logic, I'm sure it's just but not run it.  Also, if you return a large amount of data make sure that the time-out period is sufficient.

  • TimesTen - Communication between two DSN

    Hello

    Currently I have a setup in Oracle DB in which there are two databases and objects are accessible in all of these databases via the link/synonyms database.

    Now, I need to replicate that in a Cache Timesten InMemory DB underlying of Oracle databases configuration that would involve the creation of a link between two DSN names stored on two different servers.

    Can you guide me on how to go about it.

    Thank you
    Karan

    Unfortunately there are several constraints here that aren't going to help you:

    1. when using the TimesTen "cache" feature a single TimesTen database can only cache data to a backend Oracle single instance. Only regular tables can be cached (not views, dblinks etc.). So, if you have two instances of Oracle Db and you need data in cache at the same time you will need two TimesTen databases.

    2. as mentioned, TimesTen does not support dblinks, remote queries or queries/transactions distributed between various databases TimesTen (well, what he does in some circumstances, but anything that will help you I think).

    3 TimesTen can replicate data between different databases TimesTen, but in general you can not use the level replication table with cache tables.

    So I think, to adopt TimesTen in your application as an important architectural work may be necessary. Only you can be the judge of that, of course, but considering this please keep in mind the constraints above.

    Kind regards

    Chris

  • 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

  • Communication between two hosts on the host only

    I have a host ESXi 5.5 with two reviews, a Linux / Centos 6.5 comments and a guest Server R2 2012.

    I've muddled through many questions - time zone, being the biggest problem, but am confused on how to get these guests to see one another, not even sure what to put in Google.

    My goal is to be able to share files between the two guests and access their consoles with putty and RDP, but I can't make them one ping to another. Everyone on the LAN can connect these two guests, but they cannot see.

    A kind soul told me that I forgot?

    Thank you

    Hey katycomputersystems,

    Could you give us a quick screenshot of your vSwitch / Port groups.

    Of the IP information you should be able to ping to each of the systems if they are on the same vSwitch / Portgroup / VLAN.

    Try this

    vSwitch0

    VM Network - Port Group - VLAN 110 - physical Nic don't matter we will keep all the VMS on this port group

    Configure all your VMS on the port network of VM group.  As long as all the VM living on the same port group vlan and vSwitch traffic should never leave this vSwitch and each VM must be able to communicate with each other.  If not you can always ping each other take off the VLAN and try again.  Make sure also that you have no firewall or tables ip enabled on the operating systems that could prevent communication.

    Let us know how it goes

  • How to enable wireless communication between two clients?

    I've got a WRT54GL with the latest firmware.  I have two computers that are both connected to the router with the IP via DHCP addresses.  Nor has a firewall running.  I can't communicate with them - even ping does not work.  I can ping the router itself by using the IP address assigned to this side WAN by my ISP.   Both computers have no problem to reach the internet through the router.

    What the router settings will allow communication to occur?  I can't find anything in the user interface of the router, which seems to control it.

    Thank you.

    I just figured out the problem: Isolation AP (in advanced wireless settings) has been activated.  I turned it off, and the problem is solved.

  • Communication between two network cards on windows 2003

    Hi all

    I need your help.

    I have a machine virtual windows 2003 with two network adapters.

    NIC 1 - external - 192.168.1.101

    Map NETWORK 2 10.10.10.1 - internal -.

    I've configured to operate as a DC and DNS serving 10.10.10.x network.

    DNS is configured to resolve before on 192.168.1.1 as redirector DNS requests.

    I have other machines connected to the 10.10.10.x network.

    They can ping 10.10.10.1, they can ping 192.168.1.101 but not 192.168.1.1

    I want to just be able to talk to 192.168.1.1 and be able to access the internet.

    No firewall between the two.

    Command-line may help, but I would need your help.

    Hello Prasad,

    The problem you are having is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the IT Pro TechNet public.

    Please post your question in the TechNet Forum.

    https://social.technet.Microsoft.com/forums/en-us/home?category=WindowsServer&filter=AllTypes&sort=lastpostdesc

    Hope this helps you solve the problem, if any question you can write us and we will be happy to help you further.

  • Channels of communication between two applications?

    Hi Experts,

    Y at - it anyway (s) for two applications on the same device to talk to eachother? Something like a local socket communication?

    Thank you

    MoWriter

    Hi there did you look at this KB?

    http://supportforums.BlackBerry.com/T5/Java-development/communicating-with-other-applications/Ta-p/4...

  • Communication between two EAR

    Hello

    I have two EARS, deployed on an application server. If I want to call a method in the object of the EAR 2 What are the options?

    Thank you
    CGI

    jtahlborn wrote:

    If the OP calls between the ears, local EJB calls should not be used. EJBs them must be used within a unit deployed (i.e. an ear).

    If the ears are in the same VM then local can be used. Local's VM not even the same deployment unit. If it of a good idea or not is another matter.

  • Communication between two extensions of a bundle

    Hello

    I use builder extension 3.4 SDK with Flash Builder 4.6 on Mac.

    I have 2 extensions in my package that are properly created. The first is a model and a data that I need for my second.

    Is there a way to call the first extension in the second, getting the data you want? I am looking for a way to communicate between 2 extensions of the same whole. I think to create my own events...  Existing methods, how about in the SDK?

    Thank you

    A solution that has worked for me in the past is to communicate through events CSXS - your first extension would register a listener for some types of events, and your second extension would send events with this same type. Something like:

    A: extension

    CSXSInterface.getInstance () .addEventListener (B_TO_A_EVENT, myEventHandler);

    B: extension

    CSXSInterface.getInstance () .dispatchEvent (B_TO_A_EVENT, myCSXSEvent);

    If you require communication in both directions you can also add an event listener in the Extension B and the expedition of Extension.

    Hope that helps!

    -Louis

  • Communication between two projects

    Hello
    I have two projects in my application, DataModel and UserInterface. In the DataModel package, I asked Modul where to add my custom code. In the UserInterface package I have custom Java class. Now I would like to access this class of Application Modul in the DataModel package. Y at - it anyway how to proceed? Because the import does not work in this case. Thank you.

    1. right click your project
    2. go in the project properties
    3. Select the dependencies
    4. Select your projects depended

  • Communication between two Sites

    Hello

    I need help on this particular question.

    I have a client that wants to connect two rooms by a conference of Cisco, he already has tv monitors so he does not want to invest on the screens of Cisco, but he needs the codec with the camera for video meeting with the other site.

    He already has the CUCM, my question is:

    (1) do I need a license to add codecs to the CUCM?

    (2) is licensed for each necessary codec?

    Thanks in advance,

    Hi Andres,

    (1) Yes, you need to license telepresence room to add the codec.

    (2) each Codec would require licensed telepresence room.

    For example: in your case if you go with the SX10, you will need two license like you it will be deployed in the two rooms.

    Please note so useful.

    Kind regards

    Adarsh Chauhan

  • Question of VLAN.  Communication between two Vlan

    Hello

    We have a network of laboratories.  My ESX Server has two cards on this segment under a Vswitch named Lab_Lan (under default vlan0).  We already have a few virtual machine running on this segment of the lab.  I would like to create two new vlan to simulate the two region.  But for what I understand him Vlan cannot communicate with each other easily. ?  We allow Vlan Trunk on the physical switch?  There is no way to do it in the ESX only... ? Perhaps via a software router?  I need these two new VLANs (1 and 2) can communicate with each other.

    Thanks for the help...

    Don't forget: If you find this information useful, please give points to "correct" or "useful".

    ESX does not routing for VM.

    You can do this with some switches, Layer 3, or with a device of linux that act as a router (with two interfaces).

    André

Maybe you are looking for

  • Not touch event timestamp in milliseconds

    Touch horodateurs event seem to be in microseconds instead of milliseconds. The test page prints below touchstart and timestamps touchstart event in the box. http://www.apprisant.com/tab/TS.html

  • 2 sides print on 7400 with Mountain Lion

    I can't print on both sides of the paper. In preferences under print & scan setting driver Hp printing face two box was not checked, but it is now. on print in Word screen when I click on the arrows on the predefined area and then click on see the pr

  • Want to change the position of the button

    I use HorizontalFieldManager and it it I add 2 buttons 'Add' and 'sub '. So I need to position Center butttons How, how to perform the positioning of the button

  • Remote SSH connection fall

    Hello I have a Cisco 1721 I configured to allow SSH connections in the Internet router on port 2922. For some reason, the SSH connection randomly gets abandoned, most of the time in the middle of typing a command. I don't think it is related to the l

  • Canon's RAW 80 d and Photoshop CS6 files

    I try to open RAW files with my new 80 d on Lightroom CS5 and Photoshop CS6.  I have Camera RAW 9.1.1. What is the more up-to-date for CS6 version.  I have to buy Adobe CC in order to use this unit with this Adobe products.  Would mean that I have to