Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Structure elements not being set in CF9

Participant ,
Nov 19, 2009 Nov 19, 2009

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

379
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 19, 2009 Nov 19, 2009

It works exactly as I would expect, for me.

Sorry.

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 19, 2009 Nov 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 19, 2009 Nov 19, 2009
LATEST

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);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources