Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Updating TextBox with an Array value on DropDown Exit (javascript)

Avatar

Level 2

Hi all,

For the purposes if this example, assume that the following function...

sco.searchCPL(commercialProductList, ProductSelected)

...would pull an array of items as follows...

"North Sydney Vehicles - Online", "NorthSydney_Vehicles_Online", "users", 48.40, 2.42, 0.97

On my actual form, I have two objects - a DropDown called "Item2Product" and a TextBox called "Item2Cost".

In the "EXIT" section of the Item2Product dropdown I am attempting to update the text in the Item2Cost object as follows...

var ProductSelected = "NorthSydney_Vehicles_Online";
var ScopeProductSelected = sco.searchCPL(commercialProductList, ProductSelected);
Item2Cost.rawValue = ScopeProductSelected[4];

I would expect this to put "2.42" in the Item2Cost textbox.  It doesn't work.  Any ideas what i might be doing wrong?

If you would like a complete (more lengthy) explanation of the scenario, let me know and I will post it.


Cheers,

Stanbridge

PS: this array effort is a completely revamped version of my query posted here (which is no longer relevant, thus the new topic)...
http://forums.adobe.com/message/3701755#3701755

1 Reply

Avatar

Level 2

Hi all,

Nevermind, it was an issue with referencing in my function.

sco.searchCPL(commercialProductList, ProductSelected)

...should have been...

sco.searchCPL(sco.commercialProductList, sco.ProductSelected)

...as these were also being stored globally.

Cheers,

Stanbridge