It’s the ComboCellRenderer dispatching the statusChanged event?  In that case the addEventListener is on the wrong thing because it’s not main dispatching the event.  I think if the ComboCellRenderer does listOwner.parentDocument.dispatchEvent({type: ‘statusChanged’}) then it will execute on main.mxml.

 

Matt

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Mohanraj Jayaraman
Sent: Tuesday, May 24, 2005 4:53 PM
To: [email protected]
Subject: [flexcoders] Dispathching and Event from Combo Box cell renderer

 

Hi ,

I have a main.mxml where I have this DataGrid

      function initListener(){
        addEventListener("statusChanged",
mx.utils.Delegate.create(this, onStatusChange));
      }

      function onStatusChange(e){
            mx.controls.Alert.show("listener is Listening"); }


    <mx:DataGrid id="datagrid1" rowHeight="100"
dataProvider="{tp}" editable="true" >
      <mx:columns>
        <mx:Array>
          <mx:DataGridColumn headerText="Name"
columnName="name" editable="false"/>
          <mx:DataGridColumn headerText="City"
columnName="city" editable="false" />
              <mx:DataGridColumn headerText="Birthday"
columnName="day" />
              <mx:DataGridColumn headerText="Status"
columnName="status" editable="true"
cellRenderer="ComboCellRenderer" />
           
        </mx:Array>
      </mx:columns>
    </mx:DataGrid>


Whenever the combox box value is changed I want to
call a remote object with the datagrid's selectedItem
object.

I am handling the 'change' event in the
ComboCellRenderer and dispatching a 'statusChanged'
event and I also have a listener attached to main.mxml
for the 'statusChanged' event. But whenever the combo
box value is changed the listener function
onStatusChange in main.mxml is not called.

Can you tell me what I am missing here?

Thanks
Mohan


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com



Yahoo! Groups Links

Reply via email to