|
Well actually “Day” is a custom object defined in a Day.as file. It is a date property of type Date. (I guess I should probably come up with more unique names for all these pieces.) It seems to work fine in other places. When I was calling this formatter in a tilelist with this code, it worked.
<!--mx:Binding source="days" destination="list.dataProvider"/-->
…
<!--mx:TileList id="list" itemRenderer="dayFormat" width="100%" maxColumns="7"/-->
Then I could access the properties of the Day object such with data.date, data.formatedDate and data.inMonth. But in my current code this does not seem to be working as I expected, but is also not throwing any errors.
Your code would work if dayData was a Date, instead of Day. If it's
--------------
-- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
YAHOO! GROUPS LINKS
|
--- Begin Message ---
Your code would work if dayData was a Date, instead of Day. If it's
just a number, perhaps you should use a number formatter instead.
-TH
--- In [EMAIL PROTECTED]ups.com , "Ian Skinner" <ian.skinner@...>
wrote:
>
> I have modified my code calling a custom component to pass in the
entire object rather then just the date property of the object.
This seems to be working as I get a display of the proper number of
objects without any error thrown. But the display of the date of
the object is a blank space.
>
> Can somebody explain why passing the entire object, rather then
one property of the object, is causing me a problem?
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:VBox xmlns:mx="http://www.adobe.com/2006/ " width="100%"mxml >
> <mx:Script>
> <![CDATA[
> import Day;
>
> //Define public variables
> [Bindable]
> public var dayData:Day;
> ]]>
> </mx:Script>
>
> <mx:DateFormatter id="dayNum" formatString="DD" />
>
> <mx:HBox backgroundColor="0x002649" width="100%"
horizontalAlign="right">
> <mx:Label text="{dayData.toString( )}"
color="white" />
> <mx:HBox backgroundColor="0xAF1E2D"
horizontalAlign="center">
> <mx:Label text="{dayNum.format
(dayData.date)}" color="white" />
> </mx:HBox>
> </mx:HBox>
> </mx:VBox>
>
> I call this custom component with the following code.
>
> <mx:Repeater id="dayCells" dataProvider="{days}"
startingIndex="{weekRows. currentItem} " count="7">
> <mx:GridItem width="14%">
> <ian:dayFormat2 dayData="{dayCells.currentItem as
Day}" />
> </mx:GridItem>
> </mx:Repeater>
>
>
> --------------
> 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.
>
--- End Message ---

