COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: lalitha.nov20 on 06 Jan 2014 06:22:48 AM

Title: Hide and Display tree prompt on report page
Post by: lalitha.nov20 on 06 Jan 2014 06:22:48 AM
Hi All,

We have requirement where in we need to display the tree prompt or hide based on the click on the arrow.

Description: When the user run the report I need to display the default selection of the tree prompt value in the text box and display arrow beside it. (Similar to value prompt). when clicked on the arrow, tree prompt should be displayed for the user to selection.

To achieve the same , here is the expression is used in javascript

---- script the get the arrow
<a href="JavaScript:ShowHide()"><font size="1">&nabla;</font></a>
-- reference name to the tree prompt
<span id="myTree" >  </span>
--function showhide()
<script language="javascript">
function ShowHide(){
var el = document.getElementById("myTree").style.display=document.getElementById("myTree").style.display=='none'?'block':'none';
                  }

</script>

--script when mouse is clicked on any value in the tree prompt to hide the prompt and submit the report.
<script>

document.getElementById("myTree").onmousedown=function()
{runTree('MyTreePrompt1')}; </script>


<script> function runTree(id) { 
t=setTimeout('checkTree("'+id+'")',200);

} </script>



<script> function checkTree(id)

selectedTreeNode  = window.treeMyTreePrompt1.getLastSelectedNode();
if(!selectedTreeNode) {return}   
document.getElementById('myTree').style.display='none';
promptButtonFinish();
} </script>



issue in the script when  moved to 10.2 version.
In the below given script is used , it to hide the tree prompt in the initial launch of the report, it works fine. But when I try to expand the collapse/expand button in the tree prompt, it take time to load the levels.

<span id="myTree"  style="display:none">  </span>


also, another requirement, we need to point/ display the selection done previously at the top again when the tree prompt is displayed for another selection similar to value prompt, once the report is executed after selection, in the same session the selected value should be top for next time when the prompt is clicked. is this possible with tree prompt?

Thank you,
Lalitha