If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Mult-select Tree Prompt Javascript

Started by BlackDuck, 11 Aug 2009 11:28:49 PM

Previous topic - Next topic

BlackDuck

Hi,

Can someone please point me to a good resource to know how to get the multiple items selected in a Tree Prompt and dump that into a Text prompt comma delimited that then needs to be passed to a stored procedure.

I have the IBM workaround that does the same for a multi-select checkbox, so I know how to do it that way.

I have the code below, but that works for a multi-select checkbox. I am not too sure of the syntax names to change for a Tree prompt.


<!-- Licensed Material - Property of IBM -->
<!-- © Copyright IBM Corp. 2003, 2009 -->

<script>   
function assignParamValue()
{
//get the reference to the Cognos form
var fW = (typeof getFormWarpRequest == "function" ? getFormWarpRequest() : document.forms["formWarpRequest"]);   

var i, tmp;
tmp = "";
     
// get the handle for the 1st checkbox, add div to distinguish
var prompt1 = document.getElementById('checkboxPrompt1');   

// find all the children of the div of type checkboxes.
for (i=0; i < prompt1.childNodes.length; i++)
{
var node_list = prompt1.getElementsByTagName('input');
for (var i = 0; i < node_list.length; i++)
{
var node = node_list[i];
if (node.getAttribute('type') == 'checkbox')
{
   if (node.checked)
   {
   if( tmp == "" )
   {
  tmp = node.value;
   }
   else
   {
  tmp = tmp + "," + node.value;
   }
   }
}
}
}
fW._textEditBoxPostprocessing_ID.value = tmp;   
canSubmitPrompt();
promptButtonFinish();
//setTimeout("promptButtonFinish();",0);

}
</script>   


kevinsalazar

I have the identical problem.  I have a multi-select tree prompt that I want to parse and pass to a stored procedure.  Right now, the stored procedure is waiting for different levels of a tree (a product hierarchy), so I'm trying to avoid having to alter this stored procedure and open another can of worms.

Any advice would be greatly appreciated - especially if you got this figured out.  Thanks!


Kevin