- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2015 03:01 AM
Hi All
I have a requirement to clear all the options selected in the right slush busket from a list collector when a variable say ' Customer' is changed instead of moving them to the left side because there is already an onchange script for the filter for every change of customer a set of new values get populated in the list collector. So when I change the customer the selected values in the list collector should disappear and show none .
Immediate help is appreciated.
this is for one customer when I change the customer it should be as shown below
Thanks
Zabee.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2015 05:17 AM
Try this:
OnChange of customer:
var varName = 'Name of your list collector';
var rightBucket = gel(varName + '_select_1');
var selectedOptions = rightBucket.options;
for(var i = 0; i < selectedOptions.length; i++){
//Check for the item to add here based on sys_id
var value = selectedOptions[i].value;
rightBucket.remove(value);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2015 07:50 PM
Try this:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var varName = 'TestListCollector';
var rightBucket = gel(varName + '_select_1');
var leftBucket = gel(varName + '_select_0');
var selectedOptions = rightBucket.options;
for (var i = selectedOptions.length - 1; i > -1; i--)
{
rightBucket.remove(selectedOptions[i]);
leftBucket .add(selectedOptions[i]);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2015 04:36 AM
hello mujtaba,
document.getElementsByClassName('tdwrap')[0].style.display='none';
document.getElementById("ep").rows[0].style.display="none";
document.getElementById("ep").rows[1].style.display="none";
The script is working fine but the issue is the filter doesn't get hidden on load after my instance is upgraded to Fuji patch7-hotfix-5, can you please help me regarding this .
The above three lines of script is the one for hiding filters which worked fine before the upgrade.
Thanks and regards,
Zabeeulla

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2015 07:53 PM
Can you do a view source and search for ID="ep" and class="tdwrap"? Let me know if you are able to find them.
I just want to make sure that they have not changed the ids and classname.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2017 04:48 AM
Hi Mujtaba,
I have tried the snippet given by you to clear the "right list collector" values when the certain field value changes but it will not be set to "-None-" after it. So, the mandatory will not be shown. could you please tell how to do this.
var varName = 'TestListCollector';
var rightBucket = gel(varName + '_select_1');
var leftBucket = gel(varName + '_select_0');
var selectedOptions = rightBucket.options;
for (var i = selectedOptions.length - 1; i > -1; i--)
{
rightBucket.remove(selectedOptions[i]);
}
Also, I have tried below code snippet but it was removing only 3 values when I added 5 in "selected filed of list collector". May I know why it is not clearing all values
var varName = 'Name of your list collector';
var rightBucket = gel(varName + '_select_1');
var selectedOptions = rightBucket.options;
for(var i = 0; i < selectedOptions.length; i++){
//Check for the item to add here based on sys_id
var value = selectedOptions[i].value;
rightBucket.remove(value);
}
It will be great helpful, if you answer this asap.
Thanks,
Sowmya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2017 06:09 AM
Please see my comment back in June - I think you have the same issue I found (and fixed)