Friday, November 23, 2007

Cognos Java Script Learning I

I am now expanding my knowledge on using Java Script in the Cognos ReportNet. I have gone through the following Cognos help link which describes the code to clear the selections from multiple multi-select boxes with a single click.
We have to use the following Javascript in the HTML Item to deselect the selections of a List Box.
listBox_..._deSelectAll() for all the list boxes.
I am writing a custom function in Java Script called ClearAll() which will clear the all the list boxes referring inside the function.
function clearAll()
{
listBox_Parm_Region.deSelectAll()
listBox_Parm_Product.deSelectAll()
}
In the above function Parm_Region and Parm_Product are the list box name in the Prompt page.
I am calling that function on the click of one button. The following code is used to add a button in the prompt page. When clicking that button, function ClearAll will be executed.

" <button style="" class="clsPromptButton" onmouseover="this.className = 'clsPromptButtonOver'" onmouseout="this.className = 'clsPromptButton'"
onClick="clearAll();">Deselect All "

http://support.cognos.com/knowledgebase/googlesearch?load_kb_document=1&dr=kb1&uniqueid=134543

I didn't triy the above code. I just skimmed and i understand the functionality. I have to try the above code soon.

No comments: