Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Multiselect values not appearing - first time after login
ashish_7800
We are using Teamsite 7,
in the instantiation form we need to populate the values of a multiselect dynamically from a config file.
When the user login first time in teamsite and uses the form none of the values appear on the multiselect until he clicks on the form, but then after the values starts appearing properly.
Has anyone faced such issues.
see the code inside init function that i am using to achieve the desired result-
function init()
{
var currBranchPath = IWDatacapture.getItem("/Config/iwBranch").getValue();
var currBranchName = currBranchPath.split("/");
var branches = IWDatacapture.getItem("/Config/selectedBranches").getValue();
var mybrancharray = branches.split(",");
var newOptions = new Array();
var optionCntr1 = 0;
for(i=0;i <= mybrancharray.length-1;i++)
{
var branch=mybrancharray
.split("/");
var branchName=branch[(branch.length - 1)];
if ( currBranchName[currBranchName.length-1].toUpperCase() != branchName.toUpperCase() )
{
newOptions[optionCntr1] = new Option(branchName,mybrancharray
,false,false);
optionCntr1++;
}
}
IWDatacapture.getItem("/Config/selectedBranch").setOptions(newOptions);
IWDatacapture.getItem("/Config/selectedBranch").setValue([0]);
IWDatacapture.getItem("/Config/selectedBranch").setRequired(true);
}
Find more posts tagged with
Comments
Adam Stoller
There's at least one piece of information you aren't showing - which is how do you call the init() function.
ashish_7800
Please find the complete custom instantiation form attached.
ashish_7800
the attachment
Sarang
Try wrapping the code with CDATA section in the script tag.
Adam Stoller
Please find the complete custom instantiation form attached.
I have to assume there's some code missing from what you posted:[html]...
var branches = IWDatacapture.getItem("/Config/selectedBranches").getValue();
var mybrancharray = branches.split(",");
...
for(i=0;i <= mybrancharray.length-1;i++) {
..
}
...
Selected Branch
...[/html]The above doesn't make sense - there's no value in selectedBranches, so you split it to create an array (but there's nothing to split on) and then you cycle through that [empty] array to create a set of options for the select list.
I'm surprised this
ever
works - as posted - I have to assume that there's something that is supposed to be populating that value from within the WFM because there doesn't appear to be anything populating it from the code you posted.
To debug it further - I'd recommend putting a bunch of
alert();
statements around the section of code indicated above, so that you can find out what is / is not happening there.
ashish_7800
HI Ghoti,
We are using WFM and the variable "selectedBranches" is getting populated as part of preprocessor.
And as mentioned earlier the code is working fine its just that first time when the form loads (after login )the multiselect values do not show until i click on the form.
But after that the form starts loading properly and i don't need a click to display the values in the multiselect.
A little wierd...
Adam Stoller
It does sound a bit weird. I haven't used preprocessors with WFM so I can't really comment on what the "norm" is. You may want to open a case with Support.
ashish_7800
Thanks ghoti,
I will open an interwoven case and try to find a solution to it.