Ask a Question related to Macromedia Flex General Discussion, Design and Development.
-
Ian Skinner #1
Why can I pass a string, but not a date?
I have this custom component that at the moment just repeats the passed
in value. It works if I pass in a string, but if I pass the date I
actually want it does not work. I can not figure out why.
dayFormat2 custom component.
<mx:Script>
<![CDATA[
//Define public variables
public var dayData:String;
]]>
</mx:Script>
<mx:DateFormatter id="dayNum" formatString="DD" />
<mx:Label text="{dayData}" />
-----------------------
This Works.
<ns1:dayFormat2 dayData="George" />
This Does not work.
<ns1:dayFormat2 dayData="{DayNum.format(dayCells.currentItem.date) }" />
And neither does this. Of course for this version I change the dayData
type to date in the custom component.
<ns1:dayFormat2 dayData="{dayCells.currentItem.date}" />
Just to make sure that the date exists as I expect. If I replace the
dayFormat2 custome comment with a label, I get the dates just fine.
<mx:Label text="{DayNum.format(dayCells.currentItem.date)}" />
Ian Skinner Guest
-
Pass Date to Webservice
Trying to pass a date to a webservice using a String formatted as '2007-10-30T12:00:00'. Webservice is set up expecting date as a Calendar. Get a... -
Pass XML string to a URL
I need to pass a xml string to the URL. and return I will get a XML response. I need to pass the varible in an online form and send the result in... -
& in a string to pass through url param
I am trying to add a list/menu in DW2004, and for each option I need to pass url paramerters the problem I am having is concantinating & in a string... -
Pass a Date to stored procedure
Hello. I have a stored procedure that accepts a Date field as one of its parameters. When I try to run the webservice that I wrote to call the... -
How to pass <br> string to webservice ?
Greetings, I have asp.net page with a textbox. This textbox is used to pass values(mainly strings) to VB.NET webservice using... -
Simfluence #2
Re: Why can I pass a string, but not a date?
Well I cant tell you why it works with "george" as the data, but I know that a
date that is formated is not a date anymore, its just a string.
I had this problem a little while back where I was trying to store a formated
string as an attribute of my object but it never stored correctly. After
asking around I found I had to write a function that could take my formated
date string and construct a real date object to be used later.
Hope that helps put you on the right track.
simeon
Simfluence Guest
-
Ian Skinner #3
Re: Why can I pass a string, but not a date?
I have tried it both ways, to pass the date itself and a formated string
of the date, since the hard coded string worked. Neither provides any
results. I just get a blank screen. No error, just a blank screen.
Simfluence wrote:> Well I cant tell you why it works with "george" as the data, but I know that a
> date that is formated is not a date anymore, its just a string.
>
> I had this problem a little while back where I was trying to store a formated
> string as an attribute of my object but it never stored correctly. After
> asking around I found I had to write a function that could take my formated
> date string and construct a real date object to be used later.
>
> Hope that helps put you on the right track.
>
> simeon
>
>Ian Skinner Guest
-
Ian Skinner #4
Re: Why can I pass a string, but not a date?
add the bindable meta in your custom component...seems like that would
be needed.
//Define public variables
[Bindable]
public var dayData:String;
Ian Skinner wrote:> I have this custom component that at the moment just repeats the passed
> in value. It works if I pass in a string, but if I pass the date I
> actually want it does not work. I can not figure out why.
>
> dayFormat2 custom component.
> <mx:Script>
> <![CDATA[
> //Define public variables
> public var dayData:String;
> ]]>
> </mx:Script>
>
> <mx:DateFormatter id="dayNum" formatString="DD" />
> <mx:Label text="{dayData}" />
>
> -----------------------
>
> This Works.
> <ns1:dayFormat2 dayData="George" />
>
> This Does not work.
> <ns1:dayFormat2 dayData="{DayNum.format(dayCells.currentItem.date) }" />
>
> And neither does this. Of course for this version I change the dayData
> type to date in the custom component.
> <ns1:dayFormat2 dayData="{dayCells.currentItem.date}" />
>
> Just to make sure that the date exists as I expect. If I replace the
> dayFormat2 custome comment with a label, I get the dates just fine.
> <mx:Label text="{DayNum.format(dayCells.currentItem.date)}" />Ian Skinner Guest



Reply With Quote

