How to resolve error with DateField being Null value

Hello,
I have been playing with Flex on and off for a while now. I'm
getting the hand of it more, but it's simple problems I can't
resolve!
I have a DateField which is loaded from a mysql Database, it
all works fine. My problem is when creating a new record in my
database (so my array primary key is set to 0)
here is my datagrid:
Code:
<mx:DateField id = "orderdate" formatString="YYYY-MM-DD"
width="170" showToday="true" text ="{currentOrder.date}"/>
and here is my error on line 446 of DateField.as:
Code:
TypeError: Error #1009: Cannot access a property or method of
a null object reference.
at
mx.controls::DateField$/stringToDate()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\ controls\DateField.as:446]
at
mx.controls::DateField/displayDropdown()[E:\dev\3.1.0\frameworks\projects\framework\src\m x\controls\DateField.as:2118]
at Function/
http://adobe.com/AS3/2006/builtin::apply()
at
mx.core::UIComponent/callLaterDispatcher2()[E:\dev\3.1.0\frameworks\projects\framework\sr c\mx\core\UIComponent.as:8565]
at
mx.core::UIComponent/callLaterDispatcher()[E:\dev\3.1.0\frameworks\projects\framework\src \mx\core\UIComponent.as:8508]
Perhaps I add a check if the array value is null and if so
make it todays date? How can i do this?

hi there, Thanks a lot for your response
I tried your code as the code i have attached. it gives me
the warning i need quote marks
Open quote is expected for attribute "text". adman2/src/forms
OrderForm.mxml
but if i add quotations, then the datefield text appears as
the code!

Similar Messages

  • How to resolve error with code: 0xe7210001 cannot load powrprof, object:cls

    Hello there
    Doses anybody know how to resolve the error with code: 0xe7210001, message: cannot load powrprof, object:clsd-not-found;
    OR: Fingerprintsoftware error OR: THotkey.exe message window multiplicates and computer freezes
    Scanned maleware and viruses, also in safe mode, found no infection, reinstalled fingerprint driver but nothing changed.
    grateful for help!

    Hello
    > message: cannot load powrprof, object:clsd-not-found;
    In my opinion this would mean that there is a problem with Toshiba Power Saver
    What Toshiba notebook you have exactly?
    Maybe reinstalling Power Saver could help. You can find it on official Toshiba website.

  • TS3694 How to resolve error code 1015 in restoring apple iphone. Please guide

    How to resolve error code 1015 in restoring apple iphone. Please guide.

    Unauthorized modification of iOS
    http://support.apple.com/kb/HT3743
    ERROR 1015...
    This Error Code is indicative of the Device being jailbroken / Hacked...
    Sorry... But...
    The discussion of Jailbroken Devices is against the Terms of Use of this Forum.
    You will need to look elsewhere.

  • HT201210 how to resolve error 21? my iphone 4 just showing apple logo... when i'm trying to restore it... it is showing error 21 n that's not letting me restore it :( pls help

    how to resolve error 21? my iphone 4 just showing apple logo... when i'm trying to restore it... it is showing error 21 n that's not letting me restore it pls help

    From the article that the question was posted from:
    Error 1611
    This error typically occur when security software interferes with the restore and update process. Follow Troubleshooting security software issues to resolve this issue. In rare cases, this error may be a hardware issue. If the errors persist on another computer, the device may need service.
    Try reading the solutions you find in the future and follow them.

  • HT201210 how to resolve error 1015

    how to resolve error 1015

    Unauthorized modification of iOS
    http://support.apple.com/kb/HT3743
    ERROR 1015...
    This Error Code is indicative of the Device being jailbroken / Hacked...
    Sorry... But...
    The discussion of Jailbroken Devices is against the Terms of Use of this Forum.
    You will need to look elsewhere.

  • How to resolve Error "Adobe Acrobat (AcroExch.App rc=-2147221005) could not be loaded"

    How to resolve Error  "Adobe Acrobat (AcroExch.App rc=-2147221005) could not be loaded"

    What is your operating system?  Reader version?
    You get this error when doing what?

  • TS3694 Please tell me how to resolve error 1015 when trying to restore an Iphone 3g!!!!

    Please tell me how to resolve error 1015 when trying to restore an Iphone 3g!!!!

    https://discussions.apple.com/message/18540882#18540882

  • TS3694 how to resolve error code 1015 ?

    how to resolve error code 1015 ?

    Generally means you've jailbroken your phone & will most likely never be able to install a stock firmware on it.

  • HT1414 how to resolve error 1015 while restoring iphone3g to 4.2.1

    How to resolve error 1015 while restoring iphone 3g to ios 4.2.1

    This error is returned by jailbroken iPhones. Sorry, can't discuss such iPhones as per terms and conditions of this Forum.

  • How to resolve errors - ORA-01033: ORACLE, or closed, or initialized ,ORA-02063: Previous line from D1558A_IFRSQRY

    Hi Expert,
        Please tell me how to resolve errors - ORA-01033: ORACLE, or closed, or initialized ,ORA-02063: Previous line from D1558A_IFRSQRY
    Thanks and Regards

    Google is obviously broken for you: so I've posted what you need to put into your browser.
    https://www.google.co.uk/search?q=ORA-01033

  • HT4623 how to resolve error 3014

    how to resolve error 3014?

    http://support.apple.com/kb/TS3694#error3014
    This error occurs when iTunes is unable to reach gs.apple.com in a timely fashion. Follow the steps below inUnable to contact the iOS software update server gs.apple.com.

  • TS1424 how to resolve error 3194

    how to resolve error 3194??

    Just the usual diagnostic steps. Reboot your computer. Use a USB port directly on the computer, not a hub, disable security software - antivirus and firewall - completely remove iTunes, then download and install a clean copy (current version if 10.2.2), create a new user on your computer and try updating as that user, try a different computer.

  • Problem with QofQ and Null Values

    Just converted from CF5 to CF7. Finally figured out what was
    causing the error message :
    "The value "" cannot be converted to a number" when running a
    QofQ. It happens whenever there is a NULL (and I think a ZERO)
    value in the QofQ. I'm using the QofQ in a seperate chart program.
    The main query merges data from a store and a region table.
    I'm doing a LEFT OUTER JOIN to combine the REGION with the STORE,
    AND so that stores with NO SALES for a given day will show up as
    ZERO. On the main report, when I don't use a QofQWhen grouping by
    DAY or MONTH, I can test the value in the CFOUTPUT for NULL or ZERO
    and display "0" or "N/A" on the report.
    But when I try to chart it, using a QofQ to read in the
    values from the main query, and format the numbers, I get this
    error message. I've tried using the CAST function, using FLOAT,
    DOUBLE, BIGINT, etc., but still get same error message.
    The only way I could fix this is to add a WHERE statement to
    the QofQ, that only includes sales values greater than ZERO. But
    then, I have gaps in my chart because stores with NO SALES for a
    given day or MONTH don't appear. Because they are removed from the
    query. The whole point of LEFT JOINS is to include items with no
    values (or NULL) values.
    Does anyone know if it's possible to keep these values in a
    QofQ? So that items (e.g., store locations in my case) with NULL or
    ZERO values for some or all days or months can be charted? Even
    with a ZERO value? I've read everything I can get my hands on
    regarding QofQ, the CAST function, etc., but nothing seems to work.
    Thanks for any help. (FYI, didn't have this problem with CF5. It's
    QofQ could handle NULL or ZERO values without providing an error).
    Gary

    Well, I tried the IsNull function on the 3 SUM() values I was
    calculating in my SELECT statement (on a LEFT OUTER JOIN QUERY),
    and I STILL got another "cannot convert "" to a number" but this
    time the error message was more direct, and pointed me to a DATE
    field in my query, where I was SORTING AND GROUPING either by DAY
    or MONTH (depending on what user selected on form).
    In my QofQ, I'm not just reformating the integer SUM()
    values, but also the date values. So, I applied the IsNull()
    function to the DATE values in my main query. I still kept getting
    errors. But after experimenting ((SQL Server BOL docs doesn't give
    ISNULL() examples for DATE FIELDS, only NUMBER fields), I tried
    putting the dates in SINGLE QUOTES in my IsNull() function, the
    QUERY RAN. Then I wasn't sure WHAT date to enter, e.g., 1/1/1889 or
    1/1/2001, etc.
    Then, I discovered, after experimenting, that you cannot just
    blindly enter ANY date when using IsNull in a date field,
    especially if you are using CFGRAPH to chart the results by day.
    You have to select a date within the date range the user selected,
    so this means using the FORM.DATE (or URL.DATE) value from the
    form. Here's the working example from my SELECT main query:
    SELECT SUM(ISNULL(d.ttldb,0)) AS SumOfDB,
    SUM(ISNULL(d.ttldbv,0)) AS SumOfDBV,
    SUM(ISNULL(d.ttldbi,0)) AS SumOfDBI,
    <CFIF '#url.reptype#' IS "DAILY">
    ISNULL(d.depday, '#url.date1#') AS depday
    <CFELSE>
    month(ISNULL(d.depday, '#url.date2#')) AS TranMonth,
    year(ISNULL(d.depday, '#url.date2#')) AS TranYear
    </CFIF>
    Then I discovered that whatever date was used in the URL.DATE
    field (in my case it would be one of the two date field from the
    form, and depended on whether you coded DATE1 or DATE2, the chart
    would always show ZERO values for that date. So I tried putting the
    IsNull() date values in the GROUP BY and ORDER BY statements, e.g.,
    <CFIF '#url.reptype#' IS "DAILY">
    GROUP BY ISNULL(d.depday, '#url.date1#')
    ORDER BY ISNULL(d.depday, '#url.date1#') DESC
    <CFELSE>
    GROUP BY year(ISNULL(d.depday, '#url.date2#')),
    month(ISNULL(d.depday, '#url.date2#'))
    ORDER BY year(ISNULL(d.depday, '#url.date2#')),
    month(ISNULL(d.depday, '#url.date2#'))
    </CFIF>
    And this worked. The report ran just fine, and the chart
    charted every value correctly.
    I guess you have to learn all the little "quirks" about CF7
    and how it's QofQ and chart programs work. But so far, so good.
    Thank you all for your help. Now I've got to update other old
    CF5 programs that are returning errors when there are null values
    from my LEFT OUTER JOIN queries. Will take some time, but at least
    I know how to do it. Thanks to your help.
    I really appreciate your time and efforts to help with this
    issue.
    Gary

  • How to resolve Error -200265 with PXI 4461 adc

    I am getting error-200265, when  usig DAQmx Vis.Can anybody please help how to resolve the error.I have attached my Vi. Thank you in advance
    Attachments:
    DAQmx-PXI4461.vi ‏36 KB

    Hi Sparsha,
    it looks you would like to use PFI0 digital trigger but your DAQmx Trigger vi is expected Analog input. Try to select Start Digital Edge in the DAQmx Trigger vi.
    Regards,
    CaravagGIO

  • How to resolve error - 502 web server error ?

    Hello,
    Kindly consider following scenario: 
    Custom control is programmatically creating site using following code. Once site get created, it redirecting to its settings.aspx page:
    try
    SPSecurity.RunWithElevatedPrivileges(delegate()
    using (SPSite
    site1 = new
    SPSite(SPContext.Current.Site.ID))
    SPLongOperation.BeginOperation
    beginOperation = null;
    if (beginOperation ==
    null)
                             beginOperation =
    delegate(SPLongOperation
    longOperation)
                                 site1.WebApplication.Sites.Add(site1.RootWeb.Url 
                      + "/manPath/site1,
    Site1, "", 1033,TemplateName,
    __userLoginName, __userName,__userEmail);
                                 longOperation.End(site1.RootWeb.Url
    + "/manPath/site1/_layouts/settings.aspx");
    SPLongOperation.Begin(beginOperation);
    Same code works perfect at development machine, while in production it gives 502 web server errors.
    Please check below error text:
    502 - Web server received an invalid response while acting as a gateway or proxy server.
    There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.
    Results in Development machine: site gets created and redirects to its site settings page as expected.
    Results in Production machine: During the process it throws 502 web server errors, while site has got created successfully.
    I am not sure why it happened, while previously it was working. I have feeling that may be redeployment should resolve the issue, but I want to know root cause of this issue!!
    Note :  the same settings page is working well, when I open it manually in production environment!
    Please let me know the approaches to resolve this issue? Also, let me know if you need any further information on same.
    Thank you to look at this issue !
    Kind Regards,
    Dipti Chhatrapati

    Hi, I have found the things where is the issue , but still I am looking for the resolution !
    To add further on above issue, I have observed as below :
    Client machine: Following
    error is getting throw when creating new  site. 
    502 - Web server received an invalid response while acting as a gateway or proxy server. 
    There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content
    server, it received an invalid response from the content server. 
    WFEs
    machine : Error is not getting display when creating new site.
    And hence , it looks like load balancing/IIS issue, however I am not sure how to resolve the same !! 
    Please let me know your thoughts !
    Thanks and Kind Regards,
    Dipti Chhatrapati

Maybe you are looking for

  • I need to remove a video from the iTunes 12 library

    I had some movies that I had on DVD and ripped them to my computer in MP4 format. I wanted to play them on my iPad to watch during my lunch hour at work.  I thought that iPad could play native "MP4" videos, so I went to File->Add to Library and the m

  • Playing music on my iPhone after updating to iOS 5.0.1

    After updating my iPhone 4 to iOS v 5.0.1 non of the songs I have purchased through iTunes will play on the phone.  It is not possible to synch the songs to iTunes and the songs are only visible on the phone. When playing songs  the songs on the phon

  • Possible to determine hrefs from flash?

    Hi - I'm writing a web crawler. I am running into an issue with sites that use menus written with flash as I am not able to grab the hrefs. Is there a way to do this? If so could someone at least point me in the direction of where to look? I've never

  • RAC on multiple OS

    Can a RAC environment use machines with different operating systems? I understand Data Guard forces the machines to be the same os. I am having difficulty finding the same information about RAC.

  • Previous Library Size

    Hi I'm copying my previous system folder to my external hard drive. In Macintosh HD, it's size is 5,5g and while i'm copying it, it says "copying 11,79 g to external hard drive" Is this normal? Thanks K.