Ok, so your days array is a array of Day objects, correct? What does
Day.as look like and what does Day.cfc look like? That debugging
would really help. Anyother HTTP sniffer at your disposal to sniff the
traffic? Also, start your CF server via the command line. You can see some
debugging in the dos window this way and can confirm the data and datatype
returned from CF to AS too.
DK
Yes, I have a mobileCalendar.cfc that returns an array of Day objects.
<mx:RemoteObject id="svc" destination="ColdFusion"
source="flex.MobileCalendar.CF.MobileCalendar"
result="resultHandler(event)"
showBusyCursor="true" />
public function resultHandler(event:ResultEvent):void
{
var p1:ArrayCollection = new ArrayCollection();
p1.source=event.result as Array;
days = p1;
}
My day.cfc is pretty simple just now.
<cfcomponent>
<!---------------------
----- Constructor -----
---------------------->
<!--- Set Properties --->
<cfproperty name="date" type="date">
<cfproperty name="formatedDate" type="string">
<cfproperty name="inCurMonth" type="boolean">
The rest is basic setter and getter functions plus the init function.
My drawDay.as (renamed from Day.as to reduce confusion)
// Day class (maps to Day.cfc)
package
{
[Bindable]
[RemoteClass(alias="flex.MobileCalendar.CF.Day")]
public class drawDay
{
// Properties
public var date:Date;
public var formatedDate:String;
public var inCurMonth:Boolean;
public function Day():void
{
}
// toString()
public function toString():String
{
return "Date: " + formatedDate;
}
}
}
I know I am getting the array of objects because I can use them in the
main.mxml file. I can also pass them to a tile list I originaly used from the
phones example.
<!--mx:Binding source="days" destination="list.dataProvider"/-->
<!--mx:TileList id="list" itemRenderer="dayFormat" width="100%"
maxColumns="7"/-->
And then in the dayFormat.mxml file.
<mx:Label text="{Day.format(data.date)}" width="25" color="white"/>
This works just fine. So what is different about the way I am using it now?
<ian:dayFormat2 drawData="{dayCells.currentItem as drawDay}"
test="{dayCells.currentItem.formatedDate}" />
//Define public variables
[Bindable]
public var drawData:drawDay;
<mx:Label text="{dayNum.format(drawData.date)}" color="white" />
--------------
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA
---------
| 1 | |
--------- Binary Soduko
| | |
---------
"C code. C code run. Run code run. Please!"
- Cynthia Dunning
Confidentiality Notice: This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:37:2892
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/37
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:37
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.37
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54