topleft topright

Welcome, Guest. Please login or register.
September 01, 2014, 12:25:50 AM
Home Help Search Login Register
News: ATTENTION: Spambots must die! Humans must visit http://contact.futurescale.com to request forum access.

Pages: [1]
Print
Author Topic: Where'd my argument go?  (Read 1388 times)
justSteve
Courseware Beta
Sr. Member
***
Posts: 55


View Profile Email
« on: February 24, 2008, 06:26:37 AM »

Very likely, this issue isn't caused by the framework itself but it strikes me as quite strange and Flexcoders hasn't pickup on it.

I've refactored the sample Book App that David Deraedt has posted at: http://www.dehats.com/drupal/?q=node/26. My version sits at http://67.99.17.218/weborb30/CampusWO/Campus4.html?debug=true

The problem is the detail view is never passed a populated current slide - something that should happen at the 'change' event of the datagrid:

       <mx:DataGrid
               selectedItem="{selectedSlide}"
               change="selectSlide(event.target.selectedItem as Slide)"
               dataProvider="{slides}" >

Placing a breakpoint on the change property and observing the
event.target.selectedItem value shows the event is carrying the
expected info. But when execution reaches the handler:

       public var selectedSlide:Slide;
       private function selectSlide(pSlide:Slide):void
       {
               selectedSlide = pSlide ;  // pSlide is now null.
               dispatchEvent(new Event(SELECT, true));
       }

the param is null. If I remove the explicit cast to 'Slide' when calling the handler and change the signature to 'Object' ... again null.

Changing event.target.selectedItem as Slide to event.target.selectedItem.myIdentity   & the handler's signature to accept a Number _will pass the expected value.

Why no compile _or runtime error? I find that if I intentionally misspell the dataField property of one of the DG's columns, that column comes up blank but others render as expected and, again, no error reported.

Is it possible the framework is somehow masking something that prevents an error condition from bubbling high enough?

What could cause the value of 'selectedItem' to show as valid at the point that the event Handler is called but 'null' when that function is hit?

thx

Logged
Pages: [1]
Print
Jump to:  



Login with username, password and session length

Powered by SMF 1.1.11 | SMF © 2006-2007, Simple Machines LLC
Copyright © 2006-2008 Futurescale, Inc.