SpotOn Systems Blog by the Cognos Integration Experts!

Subscribe by Email

Your email:

Archived Blogs

Access archived "Where in my Cognos" and "Advanced Charting" blog posts. These posts are also available in "SpotOn the Cognos Edge" blog.

Your SpotOn the IBM Cognos Edge

Current Articles | RSS Feed RSS Feed

Accessing Prompt Controls in Cognos 8.4 with Javascript

Posted by Darren Nelson on Wed, Apr 15, 2009
  
  

Hi All,

During a recent client engagement, we came across an issue that some of you may have encountered: trying to access prompt controls at runtime.

In the past a Report Studio author could write something like this:

var x = getFormWarpRequest();
var y = x.elements["my control name"];

Of course, this is no longer the case in Cognos 8.4. Instead, the prompt control IDs are system-generated and obfuscated at runtime. In order to access the prompt controls now, you have to first obtain the obfuscated value, and then locate the control.

I've written a piece of code that seems to let me find the prompt control. I hope it helps your efforts!

In brief:

var y = searchPrompts("My prompt name");

<SCRIPT> function searchPrompts(promptName) { var SpotOnTargetControl = G_PM_THIS_.getControlByName(promptName); var SpotOnPCType=SpotOnTargetControl._type_; var SpotOnPCID = SpotOnTargetControl._id_; var SpotOnPCPrefix = ""; switch(SpotOnPCType) { case "cognos.Prompt.Control.SelectValue": SpotOnPCPrefix="PRMT_SV_"; break; case "cognos.Prompt.Control.Text": SpotOnPCPrefix="PRMT_"; break; case "cognos.Prompt.Control.DateTime": SpotOnPCPrefix="PRMT_"; break; case "cognos.Prompt.Control.Date": SpotOnPCPrefix="PRMT_"; break; } var SpotOnFW = getFormWarpRequest(); var SpotOnEL = SpotOnPCPrefix+SpotOnPCID; var SpotOnTargetElement = document.getElementById(SpotOnEL); return SpotOnTargetElement; } </SCRIPT> <A onclick='searchPrompts("TEST_LIST")' href="#">Get List named:TEST_LIST</A><BR> <A onclick='searchPrompts("TEST_TEXT")' href="#">Get Text named:TEST_TEXT</A><BR> <A onclick='searchPrompts("TEST_CALENDAR")' href="#">Get CALENDAR named:TEST_CALENDAR</A>

12 Comments Click here to read/write comments

Focus on GBI! [what the heck is a GBI...?]

Posted by Chris Ovens on Thu, Apr 09, 2009
  
  

Here is the deal; we have been very active recently in helping folks integrate high-end enterprise mapping (GIS) with Cognos 8 BI.  We've come to the conclusion that there is real value in bringing the geographic perspective to your core BI.  Hence we have gravitated to the following definition of GBI.

Perhaps influenced by the backgrounds and experience of the folks at SpotOn, we believe that BI is the foundation for GBI.  BI has been the top technology priority for CIOs for almost a decade now.  Companies count on BI for their mission-critical operations.

However, the impact and power of spatial analytics and GIS solutions are staggering.  These tools can deliver unprecedented insight into businesses, and the key operations relation to location.

The goal of this blog will be to share the learning and adventures as we collectively explore the world where Geography and BI meet.

Let get past the "why" and "what", and start digging into the "Where"!   

0 Comments Click here to read/write comments

All Posts