Element is undefined in a Java object of type class [Ljava.lang.String; referenced as

Discussion in 'Programming' started by bkendall, Sep 20, 2005.

  1. #1
    I am trying to debug a form that is basically a popup where the user enters a date and then two more dates are generated based off of date and the user can then edit those dates. When the user tries to save the second set of dates the "Element is undefined in a Java object of type class [Ljava.lang.String; referenced as" error is generated I am thinking this could just be a simple syntax error if that is the case here is the code for the page that has the error:

    
    <cfif isdefined("form.txtFFFirstDate")> <!--- used clicked save---> <cfset SESSION.Order.FrequentFlyer.Use = "Y"> <cfset SESSION.Order.FrequentFlyer.UsedAtLeastOnce = "Y"> <cfset SESSION.Order.FrequentFlyer.TargetDate = ArrayNew(1)> <cfset SESSION.Order.FrequentFlyer.TargetDate[1] = #DateFormat(form.txtFFFirstDate,"MM/DD/YYYY")#> <cfloop index="i" from="2" to="#SESSION.Order.FrequentFlyer.Count#"> <cfset SESSION.Order.FrequentFlyer.TargetDate[i] = #DateFormat(form.txtFFDateSet[i],"MM/DD/YYYY")#> </cfloop> </cfif>
    
    Code (markup):

    my other idea is that the values are never being passed to this page.

    
    
    <cfloop index="i" from="2" to="#SESSION.Order.FrequentFlyer.Count#"> <tr> <td> Date <cfoutput>#i#</cfoutput>: <input type="text" name="txtFFDateSetMonth[<cfoutput>#i#</cfoutput>]" class="txtboxdt" maxlength="2" value="<cfoutput>#Mid(DateFormat(dtTargetDate[i],"MM/DD/YYYY"),1,2)#</cfoutput>"> / <input type="text" name="txtFFDateSetDay[<cfoutput>#i#</cfoutput>]" class="txtboxdt" maxlength="2" value="<cfoutput>#Mid(DateFormat(dtTargetDate[i],"MM/DD/YYYY"),4,2)#</cfoutput>"> / <input type="text" name="txtFFDateSetYear[<cfoutput>#i#</cfoutput>]" class="txtboxdt" maxlength="2" value="<cfoutput>#Mid(DateFormat(dtTargetDate[i],"MM/DD/YYYY"),9,2)#</cfoutput>"> <input type="hidden" name="txtFFDateSet[<cfoutput>#i#</cfoutput>]"> </td> </tr> </cfloop> <input type="hidden" name="txtFFFirstDate" value="<cfoutput>#form.txtFFDateSet#</cfoutput>">
    
    
    Code (markup):
    anyway any help at all would be great
     
    bkendall, Sep 20, 2005 IP
  2. Connect

    Connect Guest

    Messages:
    191
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It is easier to debug/check from the html that is generated from the ColdFusion script.
     
    Connect, Sep 21, 2005 IP
  3. datropics

    datropics Peon

    Messages:
    309
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    0
    #3
    why does your loop start from 2 when you initialise the array and only set one element's value?

    Element 2 doesn't exist. Consider using arrayset to initialise
     
    datropics, Oct 27, 2006 IP