Skip to main content
Inspiring
November 19, 2009
Question

Structure elements not being set in CF9

  • November 19, 2009
  • 2 replies
  • 430 views

For those of you running Coldfusion 9, if you could try a simple test for me.  Create a cfm page with the following code:

<cfscript>
      addressCriteria = structNew();
      StructInsert(addressCriteria,"personId",54392);
      StructInsert(addressCriteria,"addressType","Work");
</cfscript>

<cfdump var="#addressCriteria#">

Try running it, what do you see?  You might have to try changing the personId name to something else, like "test" and reload the page.

What's happening to me, is most of the time the personId element is blank, nothing in it.  I've tried the structinsert as well as direct assignment with the same result.  If I add a third element, that seems to fix the problem.  If a couple of folks could try this and see if they get the same thing or not, that would be great.

Thanks,

Jim

    This topic has been closed for replies.

    2 replies

    BKBK
    Community Expert
    Community Expert
    November 19, 2009

    It works as expected for me, too. What happens when you play with the allowoverwrite argument, setting it to false and then to true? That is,

    StructInsert(addressCriteria,"personId",54392,false);

    StructInsert(addressCriteria,"personId",54392,true);

    Inspiring
    November 19, 2009

    It works exactly as I would expect, for me.

    Sorry.

    --

    Adam

    jim1234Author
    Inspiring
    November 19, 2009

    Classification: UNCLASSIFIED

    Caveats: NONE

    Thanks.

    After some more research and trial and error I found the problem. This is

    happening in Internet Explorer. For some reason the id is in the structure

    fine, but it simply does not show on the web page. When I click on another

    tab within the web browser, then back to the original tab it will show. Go

    figure. It's just something I need to remember when debugging.

    Jim Ward

    Web Application Architect

    U.S. Army Research Office

    919-549-4279

    DSN 832-4279