Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Listbox not properly populating the options.
vikasg18
Hi All,<br />
I have a problem with the listbox value while running the report with the tomcat integration.<br />
<br />
In my report there are two listboxes, that can be seen on the Parameter window.<br />
The prob is, when i select any option in the first listbox, then it should remove the selected option from the second listbox and show other options except selected in the first listbox.<br />
and it should happen vice-versa also.<br />
<br />
Below is the code that i have coded:<br />
It works fine, but at some point of selection, the value in the sec listbox is shown in the first listbox.<br />
<br />
Pls have a look at the code and correct me.<br />
<br />
__neh_change_select : function( event )<br />
{<br />
var element = Event.element( event ); <br />
//alert("id is:" + element.id); <br />
<br />
var masterlist = new Option();<br />
masterlist[0] = "Test1";<br />
masterlist[1] = "Test2";<br />
masterlist[2] = "Test3"; <br />
<br />
<br />
if (element.id == "listbox1")<br />
{<br />
<br />
var listBox1SelectedIndex = document.getElementById('listbox1').selectedIndex;<br />
// listBox1Options.options[listBox1Options.options.length] = new Option(masterlist);<br />
var secList=document.getElementById('listbox2');<br />
alert(listBox1SelectedIndex);<br />
<br />
for(var i = 0; i < 3; i++ ){<br />
//to add an option into the listbox2<br />
secList.options
=new Option(masterlist
,i);<br />
}<br />
secList.remove(listBox1SelectedIndex);<br />
}<br />
<br />
if (element.id == "listbox2")<br />
{ <br />
<br />
var listBox2SelectedIndex = document.getElementById('listbox2').value;<br />
var firstList = document.getElementById('listbox1');<br />
alert(listBox2SelectedIndex); <br />
<br />
for(var i = 0; i < 3; i++ ){<br />
firstList.options
=new Option(masterlist
,i);<br />
} <br />
firstList.remove(listBox2SelectedIndex);<br />
}<br />
} <br />
}<br />
);
Find more posts tagged with
Comments
There are no comments yet