Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
setValue not taking variable
jbland
In my dct I have a single select where I want to dynamically select an option. I have a function that takes in a number as a parameter and is supposed to use setValue() to select the option. However, when I put the variable in the setValue parentheses, the option is not selected. But when I put an actual number in the parentheses, the option does get selected. I have alerted the variable and it is a number. I'm using Teamsite 6.1 SP1 and here is my function.
//this function selects the subcategory choice
function chooseTheSubCat(theChoice)
{
var theSubItem = IWDatacapture.getItem("SUB_CAT");
theSubItem.setValue(theChoice);
alert(theChoice);
}
Any idea why theChoice won't work inside setValue, but a number will?
Find more posts tagged with
Comments
JonathonG
That is strange. Have you tried taking the function call out of the equation? In other words, replace the function call with the couple of lines of code? (not a long-term solution, but just a sanity check).
I assume you have something in your code that says:
chooseTheSubCat(param);
Replace that with
var theSubItem = IWDatacapture.getItem("SUB_CAT");
theSubItem.setValue(param);
And see what happens.
Jonathon
Interwoven Developer
Allstate, Inc.
jbland
No dice, still have the same problem of not getting the option selected with a variable. And it still will select the option if you put a number instead of the variable
LooseCannon
I think the arg needs to be converted to an integer
try
theSubItem.setValue(parseInt(theChoice));