Skip to main content
Participant
August 7, 2008
Question

Session/Array issue with IE7/Firefox 3

  • August 7, 2008
  • 2 replies
  • 342 views
The code below has been working fine for years in all browsers previous to IE7 and Firefox 3. But now as users upgrade to the new browsers they get the following error:

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

The offending code is:

<cfparam name="SESSION.criteria[#x#]" default="0">
<cfparam name="SESSION.operator[#x#]" default="0">
<cfparam name="SESSION.value[#x#]" default="0">

Where I'm looping over this code and 'x' is goes from 1 to say 10.

I've already declared the arrays with:

<cfset criteria = ArrayNew(1)>
<cfset operator = ArrayNew(1)>
<cfset value = ArrayNew(1)>

Any ideas? What's up with the newer browsers that causes this?

Thanks,

Craig.
    This topic has been closed for replies.

    2 replies

    Inspiring
    August 8, 2008
    when you declare your arrays, scope them properly into the SESSION scope:

    <cfset SESSION.criteria = arraynew()>

    (or you can do <cfset session.criteria = []> if you are on cf8)

    otherwise it creates a CRITERIA array in the VARIABLES scope, not in
    SESSION scope, so SESSION.criteria will not exist...

    btw, no need to declare array size if it is a 1D array

    hth

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/
    Participating Frequently
    August 8, 2008
    That error sounds like it's interpreting SESSION as a string, not a structure.

    Right above these lines, do a
    <cfdump var="#SESSION#">

    What is above these lines in the file that's throwing the error? What's in the Application.cfm file?
    CraigM01Author
    Participant
    August 8, 2008
    Thanks Kronin!

    You were right, the SESSION arrays were not being declared correctly. The cfdump suggestion got me pointed in the right direction.