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 for Multi-Select
System
Based on a specific selection from a select dropdown box, values from one multi-select dropdown populate
to another multi-select dropdown. It is within a replicant so I'm looping through the items.
However, I can't get the items in the multi-select dropdown to highlight when I use setValue.
Item that I need to copy from (this is a multi-select dropdown):
var Item = IWDatacapture.getItem("/MetaData/PermissionGroup[" + i + "]/AffiliatesGroup"); //multi-select item
var Idx = Item.getValue();
I am copying to:
var Item1 = IWDatacapture.getItem("/MetaData/AudienceGroup[" + i + "]/AffiliatesGroup"); //multi-select item
var Idx1 = Item1.getValue();
Item1.setValue([Idx]); //when these values are set, should they display highlighted in the dropdown?
There is much more code, however, I was mainly wondering if setValue on a multi-select box should
highlight the values being set.
Find more posts tagged with
Comments
Michael
ok - silly question first to get it out of the way -- at the end of your event handling are you refreshing so that changes will be displayed?
as to your question: There is much more code, however, I was mainly wondering if setValue on a multi-select box should
highlight the values being set.
I really think it should -- I haven't tried it however, sorry.
I hope this helps, but if not, post some more about what you have tried and perhaps try / post up a really simple example where you just have a single multiselect and setvalue on it and see if that works.
Good luck
Cheers
Michael
jbonifaci
Try something like this:
var Item = IWDatacapture.getItem("/MetaData/PermissionGroup[" + i + "]/AffiliatesGroup"); //multi-select item
var Idx = Item.getValue();
var Item1 = IWDatacapture.getItem("/MetaData/AudienceGroup[" + i + "]/AffiliatesGroup"); //multi-select item
var Item1Length = Item1.getOptions().length;
var newOptions = new Array();
for (var i=0;i<Item1Length;i++){
optionValue = Item1.getOptions()
.value;
optionText = Item1.getOptions()
.text;
if (optionValue == Idx){
newOptions
= new Option(optionText, optionValue, false, true);
} else {
newOptions
= new Option(optionText, optionValue, false, false);
}
}
Item1.setOptions(newOptions);
Migrateduser
Michael,
Thanks for your reply. To answer your first question, yes I do redraw.
I will try your suggestion to code a simple multi-select with setValue and see if that works.
Joy
Migrateduser
Another good suggestion. I will give it a try as well.
I think I may run into a problem because I am trying to copy from one replicant to another. It works if I am copying from one field to another field within the same replicant, however, once I try to copy from 2 different replicants, I run into trouble. I will experiment.
Thanks!!
Migrateduser
Another good suggestion. I will give it a try as well.
I think I may run into a problem because I am trying to copy from one replicant to another. It works if I am copying from one field to another field within the same replicant, however, once I try to copy from 2 different replicants, I run into trouble. I will experiment.
Thanks!!