Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think it might be better for studyId to refer to the dataGrid rather than the dataGrid referring to studyId. You can add this to your main mxml:</p> <pre><code>&lt;mx:TextArea id="studyId" text="{dataGrid.selectedItem.Study}"/&gt; </code></pre> <p>This should work because TextArea.text will respond to the property changed event of DataGrid.selectedItem, so it will change whenever the selection changes.</p> <p>EDIT: Dispatching events:</p> <p>You can dispatch an event from any place in your code, and listeners will be able to listen in to that event. Eg:</p> <pre><code>&lt;mypackage:MyComponent&gt; ... private function foo():void { dispatchEvent(new MouseEvent(MouseEvent.CLICK)); // Dispatches a mouse event whenever foo is called. } </code></pre> <p>Now you can listen for that event:</p> <pre><code>&lt;mypackage:MyComponent id="myComponent"/&gt; ... myComponent.addEventListener(MouseEvent.CLICK, mouseClickHandler); private function mouseClickHandler(event:MouseEvent):void { ... // code to handle that event here. } </code></pre> <p>Hope this helps!</p> <pre><code>&lt;mx:MainComponent creationComplete="init()" ...&gt; ... private function init(event:Event):void { ... customComponent.addEventListener(StudyEvent.STUDYSELECTED, studySelectedListener); ... } private function studySelectedListener(event:StudyEvent):void { studyid.text = event.study.studyId; // or wherever you store your studyId value ... } ... &lt;mx:MainComponent/&gt; </code></pre> <p>What happens is whenever a StudyEvent.STUDYSELECTED event is fired from your customComponent, it will be caught by your main function and studySelectedListener will be called.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload