ABSTRACT (by Federico Levis ) Category: CEL
Cognos Extension Library (CEL) Feature: Master-Detail Prompt with very quick Update (no page -refresh) and various options (Range, Tips,...)
Prerequisite: Cognos Extension Library (CEL) is installed and included in your Report
1. Features
Very quick Update of Detail when Master is changed (done by JS). No Page refresh is done as in standard Cognos implementation, requiring Cascade and Auto-Submit
All possible cases supported (CheckBox, DropDown, Multi/Single selection,..)
Example1: Master and Detail= CheckBox List Multiple
Example2: Master= DropDown Single Detail = List Multiple
Various Optional Features:
[Min...Max] Range with Validation
Example: Validation Warning with [1..100] Range
TextTip automatically updated when selection changes
Case a) 0 selected, not in ValidRange
Caseb) 2 selected, ValidRange
ImageTip showing Long Text Tip or HTML Tip:
Case a) "Long Text Tip"
Case b) HTML Tip
2. Steps to add this Feature to Your Report
Following steps are general and valid for all cases; we will simply show here all the code required to implement the CEL Solution Example1 of the Video in the Top of this Post:
In your Report enclose the Block with your Master Detail prompts in a Span with the Id that will identify your MasterDetail CEL Object. e.g id="blockFilterCity"
<Your Standard Cognos ValuePrompts>
Insert an HTML Item to include the JS of this Report. e.g:
<html> <body> <script language="javascript" src="/ibmcognos/ext/samples/MySql/sample01.js"> </script> <script type="text/javascript"> sample01_init(); </script> </body></html>
in sample01.js Create/Set cFilterCity MasterDetail Object using CEL JS API:
var cFilterCity = Object;
function sample01_init() { setOKFnValidate (sample01_validate); // Set Validate Function // Create FilterCity MasterDetail, bMasterRequired = false var cFilterCity = new cMasterDetail('FilterCity',false); // Set Valid Range cFilterCity.setSelRange(I_PROMPT_MASTER,0,10); cFilterCity.setSelRange(I_PROMPT_DETAIL,1,100); // create an AutoUpdate tipTxt for Master and Detail cFilterCity.tipTxtCreate(I_PROMPT_MASTER,true); cFilterCity.tipTxtCreate(I_PROMPT_DETAIL,true); } function sample01_validate() { return cFilterCity.validate(); }
That's all: now CEL will automatically take care of everything!