trace(dtCmplxStartDate.toDateString(0)); will not compile :-) The way I am accessing/manipulating the DateField date is through .selectedDate.
trace(dtCmplxStartDate.selectedDate); does give a valid date e.g. Tue Jul 14 00:00:00 GMT-0600 2009 whether or not the DateField is enabled - which would make it a situation where Flex is suppressing the view. I have just added a test button that disables the DateField component - it removes the displayed date from view! So it is Flex. Interesting - this component was built to always be editable then. Any solutions other than subclassing to a custom component and changing its behaviour? TIA, Mic. --- In [email protected], "Tracy Spratt" <tr...@...> wrote: > > What did the trace show? > > > > Tracy Spratt, > > Lariat Services, development services available > > _____ > > From: [email protected] [mailto:[email protected]] On > Behalf Of Mic > Sent: Friday, April 24, 2009 2:41 AM > To: [email protected] > Subject: [flexcoders] Re: Setting dateField.SelectedDate when component is > disabled? > > > > > > > > > If I leave the dateField objects enabled: > > <mx:DateField id="dtCmplxStartDate" enabled="true" /> > > then from the function: > > dtCmplxStartDate.selectedDate = tempStrtDt; > > the gui shows the date in the textInput part of the dateField component. All > I have to change is > > <mx:DateField id="dtCmplxStartDate" enabled="false"/> > > and > > dtCmplxStartDate.selectedDate = tempStrtDt; > > does not show date in gui. > > Mic. > > --- In flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.com, > "Tracy Spratt" <tracy@> wrote: > > > > What happens? How are you sure the dates are not being set? What happens > > if you do this after setting a date: > > > > Trace(dtCmplxStartDate.toDateString(0); > > > > > > > > Tracy Spratt, > > > > Lariat Services, development services available > > > > _____ > > > > From: flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.com > [mailto:flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.com] > On > > Behalf Of Mic > > Sent: Thursday, April 23, 2009 10:47 PM > > To: flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.com > > Subject: [flexcoders] Setting dateField.SelectedDate when component is > > disabled? > > > > > > > > > > > > > > > > > > In a modal View state the dateFields are disabled but I need to populate > > them for the current record. I can stick my proc values in when they are > > enabled, but not when disabled. I tried > > > > dtCmplxStartDate.enabled = true; > > dtCmplxStartDate.selectedDate = tempStrtDt; > > dtCmplxStartDate.enabled = false; > > dtCmplxEndDate.enabled = true; > > dtCmplxEndDate.selectedDate = tempEndDt; > > dtCmplxEndDate.enabled = false; > > > > but no go. TIA, > > > > Mic. > > >

