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)
javascript method inside <birt:paramDef> tag
vikasg18
pls run the below code, saving it as .html file;<br />
<br />
<html><br />
<head><br />
<script language="JavaScript"><br />
<br />
function callSelect(){<br />
<br />
var masterlist = new Option();<br />
masterlist[0] = "Payer";<br />
masterlist[1] = "CPT";<br />
masterlist[2] = "Loc";<br />
<br />
var myselect = document.getElementById('374');<br />
<br />
if(myselect.id == '374'){<br />
<br />
var listBox1SelectedIndex = document.getElementById('374').selectedIndex;<br />
var secList=document.getElementById('375');<br />
<br />
for(var i = 0; i < 3; i++ ){<br />
<br />
//to add an option into the listbox2<br />
secList.options
=new Option(masterlist
,i);<br />
}<br />
secList.remove(listBox1SelectedIndex);<br />
}}<br />
<br />
function callSelect1(){<br />
<br />
var masterlist = new Option();<br />
masterlist[0] = "Payer";<br />
masterlist[1] = "CPT";<br />
masterlist[2] = "Loc";<br />
<br />
var myselect1 = document.getElementById('375');<br />
if (myselect1.id == '375'){<br />
<br />
var listBox2SelectedIndex = document.getElementById('375').selectedIndex;<br />
var firstList = document.getElementById('374');<br />
<br />
for(var i = 0; i < 3; i++ ){<br />
firstList.options
=new Option(masterlist
,i);<br />
}<br />
firstList.remove(listBox2SelectedIndex);<br />
}}<br />
</script><br />
</head><br />
<br />
<body><br />
<center><br />
<br />
<select id="374" onChange="callSelect()"><br />
<option>Payer</option><br />
<option>CPT</option><br />
<option>Loc</option><br />
</select><br />
<br />
<select id="375" onChange="callSelect1()"><br />
<option>Payer</option><br />
<option>CPT</option><br />
<option>Loc</option><br />
</select><br />
<br />
</center><br />
</body><br />
</html><br />
<br />
The above code displays 2 listboxes in an html page.<br />
when i select an item in the first list box, then that selected item is not present in the 2listbox. thats fine.<br />
<br />
Now i have my Custom parameter page(ie: .jsp file)to generate a birt report.<br />
In that jsp page, i am displaying the listboxes thru <birt:paramDef name="listbox1" id="200"> tag rather than using <select> tag.<br />
<br />
Now, I need to call the javascript method for a listbox inside <birt:paramDef> tag, as i was calling in the <select> tag of html.<br />
I know we cannot call any js methods inside <birt:paramDef> tag, but could u tell me, is there any Alternatives for that...???<br />
<br />
-Vikas
Find more posts tagged with
Comments
mwilliams
Hi Vikas,
What script are you trying to call inside the <birt: paramDef> tag?
vikasg18
williams,
I need to call Javascript method 'callSelect()' inside<birt:paramDef> tag,
like i call the js method inside the html <select> tag.
ie: <select id="375" onChange="callSelect()">
<option value="test1">Test1</option>
<option value="test2">Test2</option>
<option value="test3">Test3</option>
</select>
-Vikas