1 Reply Latest reply on Jun 27, 2006 4:21 PM by Newsgroup_User

    Object type Coercion error.

    Level 7
      I am receiving this error:
      TypeError: Error #1034: Type Coercion failed: cannot convert
      Object@f3dfe81 to drawDay.

      When I run this code:
      <mx:Repeater
      id="dayCells"
      dataProvider="{days}"
      startingIndex="{weekRows.currentItem}"
      count="7">
      <ian:dayFormat2
      drawData="{drawDay(dayCells.currentItem)}"
      test="{dayCells.currentItem.formatedDate}">
      </ian:dayFormat2>
      </mx:Repeater>

      How can I figure out what kind of object dayCells.currentItem is being
      returned by the Repeater control? {days} is an arrayCollection of
      drawDay objects, how can I get the Repeater currentItem to be an object
      of the drawDay type?

      --------------
      Ian Skinner
      Web Programmer
      BloodSource
      www.BloodSource.org
      Sacramento, CA

      ---------
      | 1 | |
      --------- Binary Soduko
      | | |
      ---------

      "C code. C code run. Run code run. Please!"
      - Cynthia Dunning
        • 1. Re: Object type Coercion error.
          Level 7
          //Define public variables
          [Bindable]
          public var drawData:Object;

          Ok, changing the data type of the drawData variable to Object which is
          what a repeater currentItem returns worked! But is this the way I want
          this to work? Just use a generic Object type not my nice custom Object
          I create with the drawDay.as file and is returned from my drawDay.cfc
          with the remoteObject call?


          Ian Skinner wrote:
          > I am receiving this error:
          > TypeError: Error #1034: Type Coercion failed: cannot convert
          > Object@f3dfe81 to drawDay.
          >
          > When I run this code:
          > <mx:Repeater
          > id="dayCells"
          > dataProvider="{days}"
          > startingIndex="{weekRows.currentItem}"
          > count="7">
          > <ian:dayFormat2
          > drawData="{drawDay(dayCells.currentItem)}"
          > test="{dayCells.currentItem.formatedDate}">
          > </ian:dayFormat2>
          > </mx:Repeater>
          >
          > How can I figure out what kind of object dayCells.currentItem is being
          > returned by the Repeater control? {days} is an arrayCollection of
          > drawDay objects, how can I get the Repeater currentItem to be an object
          > of the drawDay type?
          >
          > --------------
          > Ian Skinner
          > Web Programmer
          > BloodSource
          > www.BloodSource.org
          > Sacramento, CA
          >
          > ---------
          > | 1 | |
          > --------- Binary Soduko
          > | | |
          > ---------
          >
          > "C code. C code run. Run code run. Please!"
          > - Cynthia Dunning