PDA

View Full Version : Call acordion.selectedIndex from different MXML Component


Integrax
11-18-2008, 01:37 AM
Ok, I have an accordion that's a component itself as follows:

<?xml version="1.0" encoding="utf-8"?>
<mx:Accordion xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" historyManagementEnabled="false" >
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.utils.UIDUtil;
import mx.events.CollectionEvent;
import mx.events.CollectionEventKind;
import mx.events.PropertyChangeEvent;
import mx.events.IndexChangedEvent;
import mx.messaging.messages.AsyncMessage;
import mx.messaging.events.MessageEvent;

]]>
</mx:Script>
<PropertyView id="MYPROPERTY" label="Property Information" width="100%" height="100%"
gridSelect = "Servicios.gridItem = event.target.selectedItem" > <!-- click="acordion.selectedIndex=1;" -->
</PropertyView>
<CustomerView id="MYCLIENTS" label="Customer Information" width="100%" height="100%">
</CustomerView>
<ServicesView id="MYSERVICES" label="Services Available" width="100%" height="100%">
</ServicesView>

</mx:Accordion>

MYPROPERTY is another MXML component with a DataGrid listing some properties.

What I need is on DataGrid Change, PropertyView colapses and CustomerView displays.

If I use click="acordion.selectedIndex=1;" accordion switch panels on any click inside PropertyView.
How to call it only from DataGrid change?

Any idea will be 100% appreciated.

Tks