943,865 Members | Top Members by Rank

Ad:
  • ColdFusion Discussion Thread
  • Unsolved
  • Views: 18849
  • ColdFusion RSS
Sep 20th, 2005
0

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

Expand Post »
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:

ColdFusion Syntax (Toggle Plain Text)
  1. <cfif isdefined("form.txtFFFirstDate")>
  2. <!--- used clicked save--->
  3. <cfset SESSION.Order.FrequentFlyer.Use = "Y">
  4. <cfset SESSION.Order.FrequentFlyer.UsedAtLeastOnce = "Y">
  5. <cfset SESSION.Order.FrequentFlyer.TargetDate = ArrayNew(1)>
  6.  
  7. <cfset SESSION.Order.FrequentFlyer.TargetDate[1] = #DateFormat(form.txtFFFirstDate,"MM/DD/YYYY")#>
  8. <cfloop index="i" from="2" to="#SESSION.Order.FrequentFlyer.Count#">
  9. <cfset SESSION.Order.FrequentFlyer.TargetDate[i] = #DateFormat(form.txtFFDateSet[i],"MM/DD/YYYY")#>
  10. </cfloop>
  11. </cfif>

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

ColdFusion Syntax (Toggle Plain Text)
  1. <cfloop index="i" from="2" to="#SESSION.Order.FrequentFlyer.Count#">
  2. <tr>
  3. <td>
  4. Date <cfoutput>#i#</cfoutput>:
  5. <input type="text" name="txtFFDateSetMonth[<cfoutput> #i# </cfoutput> ]" class="txtboxdt" maxlength="2"
  6. value="<cfoutput> #Mid(DateFormat(dtTargetDate[i],"MM/DD/YYYY"),1,2)# </cfoutput> "> /
  7. <input type="text" name="txtFFDateSetDay[<cfoutput>#i#</cfoutput>]" class="txtboxdt" maxlength="2"
  8. value="<cfoutput>#Mid(DateFormat(dtTargetDate[i],"MM/DD/YYYY"),4,2)#</cfoutput>"> /
  9. <input type="text" name="txtFFDateSetYear[<cfoutput> #i# </cfoutput> ]" class="txtboxdt" maxlength="2"
  10. value="<cfoutput> #Mid(DateFormat(dtTargetDate[i],"MM/DD/YYYY"),9,2)# </cfoutput> ">
  11. <input type="hidden" name="txtFFDateSet[<cfoutput>#i#</cfoutput>]">
  12. </td>
  13. </tr>
  14. </cfloop>
  15. <input type="hidden" name="txtFFFirstDate" value="<cfoutput> #form.txtFFDateSet# </cfoutput> ">

anyway any help at all would be great
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
bkendall is offline Offline
69 posts
since Jul 2005
Sep 20th, 2005
0

Re: Element is undefined in a Java object of type class [Ljava.lang.String; reference

the referring page has a loop that generate the value for the page that is getting the error and I am thinking that the value is not being passed to that page.

ColdFusion Syntax (Toggle Plain Text)
  1. </tr>
  2. <cfloop index="i" from="2" to="#SESSION.Order.FrequentFlyer.Count#">
  3. <tr>
  4. <td>
  5. Date <cfoutput>#i#</cfoutput>:
  6. <input type="text" name="txtFFDateSetMonth[<cfoutput> #i# </cfoutput> ]" class="txtboxdt" maxlength="2"
  7. value="<cfoutput> #Mid(DateFormat(dtTargetDate[i],"MM/DD/YYYY"),1,2)# </cfoutput> "> /
  8. <input type="text" name="txtFFDateSetDay[<cfoutput>#i#</cfoutput>]" class="txtboxdt" maxlength="2"
  9. value="<cfoutput>#Mid(DateFormat(dtTargetDate[i],"MM/DD/YYYY"),4,2)#</cfoutput>"> /
  10. <input type="text" name="txtFFDateSetYear[<cfoutput> #i# </cfoutput> ]" class="txtboxdt" maxlength="2"
  11. value="<cfoutput> #Mid(DateFormat(dtTargetDate[i],"MM/DD/YYYY"),9,2)# </cfoutput> ">
  12. <input type="hidden" name="txtFFDateSet[<cfoutput>#i#</cfoutput>]">
  13. </td>
  14. </tr>
  15. </cfloop>
  16. <input type="hidden" name="txtFFFirstDate" value="<cfoutput> #form.txtFFDateSet# </cfoutput> ">

this hidden field
ColdFusion Syntax (Toggle Plain Text)
  1. <input type="hidden" name="txtFFDateSet[<cfoutput> #i# </cfoutput> ]">
contains the undefined value. does it need a value (name="" value="") on the referring page and if so what should it be?

Forgive me in advance if I am not being clear, I have looked at this issue all day with no revelations.
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
bkendall is offline Offline
69 posts
since Jul 2005
Sep 26th, 2005
0

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

well no one responded to this post so I don't have to thank anyone but I did get it figured out and in case someone has the same trouble... I needed an eval statement in my loop so my cfset needed something like this:

ColdFusion Syntax (Toggle Plain Text)
  1. <cfset tmpDate = EVALUATE("FORM.txtFFDateSet#i#")>
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
bkendall is offline Offline
69 posts
since Jul 2005
Aug 2nd, 2010
0
Re: Element is undefined in a Java object of type class [Ljava.lang.String; referenced as
Well, I can now thank you for answering your own question.

I had the same problem and it occurred because I was passing variables from Argument as ARGUMENT.myclass.variable1 instead of using a getter method and turn it into ARGUMENT.myclass.getVariable1().

Once I made that change, it worked.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
tsancio is offline Offline
1 posts
since Aug 2010
Aug 3rd, 2010
0
Re: Element is undefined in a Java object of type class [Ljava.lang.String; referenced as
Sorry to wake the zombies (this thread is 5 years old...). But for newer CF versions use array notation, not evaluate()

<cfset tmpDate = FORM["txtFFDateSet#i#"] >
Reputation Points: 32
Solved Threads: 44
Posting Whiz
arrgh is offline Offline
349 posts
since Dec 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ColdFusion Forum Timeline: Reporting help
Next Thread in ColdFusion Forum Timeline: Value of Previous Row





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC