Skip to Main Content

Drill Down to Check box in Obiee 10g

Rookie_86Sep 20 2012 — edited Sep 26 2012
Hi users,

I created a Drill Down prompt in obiee 10g.
My users - find multi select prompt to be too complex for lay man who use internet.

So, they want me to develop the check box prompt.
With the help of following java script placed in text object in d/b below prompt:

I was able to represent the prompts as checkbox and pass the values.
But, here i was unable to select multiple values from one column.
But, able to select multiple values from diff. columns.



<script type="text/javascript">
function getElementsByClass(searchClass,node,tag)
{

var classElements = new Array();
if ( node == null )
node = document;
if ( tag == null )
tag = '*';
var els = node.getElementsByTagName(tag);
var elsLen = els.length;
var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");

for (i = 0, j = 0; i < elsLen; i++) {
if ( pattern.test(els.className) ) {
classElements[j] = els[i];
j++;
}
}
return classElements;
}

var tables = getElementsByClass('DashboardPromptViewTable',null, 'table');

for (var table = 0; table < tables.length; table++){

var stringFunc = '';
var selects = tables[table].getElementsByTagName('select');

if ( selects.length == undefined || selects.length == 0 || selects[0].name === 'Match'){
if (debug === 1) { document.write("No selects found. Continue to next record."+"<BR>");}
continue; // This DB Prompt doesn't have any select statements
}

var spans = getElementsByClass('minibuttonOn',tables[table],'span');



stringFunc = stringFunc.substr(stringFunc.indexOf('{')+1, stringFunc.length - 2 - stringFunc.indexOf('{'));

for (var s =0; s < selects.length; s++){
var new_form = document.createElement('form');
var options = selects[s].getElementsByTagName('option');
new_form.name = selects[s].name+"_radio";
new_form.id = selects[s].id+"_radio";
for (var o=0; o<options.length; o++)
{
if (options[o].value != "*)nqgtnone(*")
{
var new_input = document.createElement('input');
new_input.type = 'checkbox';
new_input.value = options[o].value;
new_input.name = selects[s].name+"_radio";
if(selects[s].selectedIndex == o){
new_input.checked = true;
}
var onClickStringFunc = "var sel = document.getElementById(this.name.substr(0,this.name.length-6));" +
"if ( sel == null){"+"return;"+"}"+ "var opts = sel.getElementsByTagName('option');"+
"for( var opt = 0; opt < opts.length; opt++){"+
"if( opts[opt].value == this.value){"+
"sel.selectedIndex = opt;"+
"}"+
"}"; new_input.onclick = new Function(onClickStringFunc + stringFunc);
var new_text = document.createTextNode(options[o].innerHTML);
new_form.appendChild(new_input);
new_form.appendChild(new_text);
}
} // end options for loop
selects[s].parentNode.insertBefore(new_form,selects[s]);
selects[s].style.display="none";
} // end selects for loop
} // end table foor loop
</script>


Experts, with Obiee & Java please, guide me how to resolve this issue.

Edited by: GRK on Sep 20, 2012 11:10 AM
Comments