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

Setting the Value of a Text Box Prompt with Javascript in Cognos 8.4

Posted by Darren Nelson on Thu, Oct 15, 2009
  | Submit to Digg digg it |  Add to delicious  delicious |  Submit to StumbleUpon StumbleUpon | Submit to Reddit reddit 

Hello again,

I've been working through a specific issue where I wanted to dynamically set the value of a Cognos 8.4 Text Box Prompt with Javascript. I immediately went to my previous blog posting to copy and paste the code! Unfortunately, this only got me half way.

Since the Cognos prompts aren't simply HTML form elements, it did not suffice to try searchPrompts("Address").value="HELLO!!!". What I REALLY needed to do was simulate the user typing the desired text. So, after spending some time trying to understand what is going on in the background, I'm pleased to announce that with just a few lines of Javascript, I can easily set the value!

<SCRIPT> function setTextBoxPromptValue(promptName, promptValue) { var SpotOnTargetControl = G_PM_THIS_.getControlByName(promptName); var SpotOnPCType=SpotOnTargetControl._type_; if(SpotOnPCType == "cognos.Prompt.Control.Text") { SpotOnTargetControl.bParse(promptValue,""); SpotOnTargetControl.setCurrentValue(); SpotOnTargetControl.checkData(); } } </SCRIPT> <A onclick='setTextBoxPromptValue("Address","520 Bronson Ave.")' href="#">Set Value for Address</A><BR>

2 Comments Click here to read/write comments

Accessing Prompt Controls in Cognos 8.4 with Javascript

Posted by Darren Nelson on Wed, Apr 15, 2009
  | Submit to Digg digg it |  Add to delicious  delicious |  Submit to StumbleUpon StumbleUpon | Submit to Reddit reddit 

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>


3 Comments Click here to read/write comments

Striking the S-Word “Support” from my lexicon

Posted by Darren Nelson on Wed, Dec 03, 2008
  | Submit to Digg digg it |  Add to delicious  delicious |  Submit to StumbleUpon StumbleUpon | Submit to Reddit reddit 

Every organization supports their clients. Few organizations succeed with their clients. That's the "ah-hah!" moment I had recently while Chris and I were discussing how to handle client issues. As a former Cognoid, I know how large organizations manage calls from customers. There are several key metrics used in call centers such as AHT (average handle time) or call cost per minute, to measure the efficiency of an operation. I think these are very beneficial tools to use when dealing with huge numbers of calls on many different products.

In a small organization like ours, we deal with client calls regarding product issues as well. The difference is that we know our clients much better than someone staffing a 24 hour terminal. That's why we no longer want to reactively support our clients but rather, proactively succeed with them. How did we pinpoint this? In a recent revenue opportunity with one of our trusted partners, an issue arose around a particularity with their client's environment. I'm sure we've all encountered this before. So, the partner followed our support process, our staff responded exactly the way they should have responded - if we were a large call center. That is to say, SpotOn assessed the issue, requested the required information, and delivered the solution. The problem with that was, the solution didn't solve the problem and an entire day went by.

So here it is: The line in the sand. SpotOn clients and partners, we're going to succeed together, rather than solving individual issues as they pop up!

- Darren


0 Comments Click here to read/write comments

Introducing: SpotOn CTO and Keeper of the Cognos SDK “Secret Sauce”

Posted by Darren Nelson on Thu, Aug 07, 2008
  | Submit to Digg digg it |  Add to delicious  delicious |  Submit to StumbleUpon StumbleUpon | Submit to Reddit reddit 

Hi, I'm Darren Nelson and welcome to my first blog post - Chris badgered me to do it.  I'll start off with a little bit about myself.  I was fortunate enough to develop the original ReportNet and Cognos 8 SDK and I continue to work with it on a daily basis.  Those early ReportNet days were pretty wild.  The BI market was primed and ready for a web-based BI platform, and the ReportNet solution hit the mark - almost too well for its own good.  Let me explain.

Reporting is effectively a horizontal solution - everybody needs information.  Organizations making significant investments in BI want the solution to meet their key VERTICAL requirements.  The ReportNet design team recognized that the solution could not be everything to everyone - thus tasked me to provide the keys to the castle in the form of the Software Development Kit (SDK).  This was one of my most memorable projects. When I began, I was perfectly fluent in English and French (written and spoken). By the time ReportNet launched, I was also fluent in SOAP (written and spoken)! 

I'm not sure anybody could have guessed the velocity that ReportNet would hit the market with.   Astounding for what was a V1 solution!  I'm not sure if anybody predicted how much these major early adopters would leverage the SDK to build out custom functionality or tightly integrate the solution into existing environments and applications. 

After a few years of "assisting" (read: chief cook and bottle washer) with these SDK initiatives, I moved to the Cognos OEM team; where my daily activities finally fell in line with my actual job description. 

Now I've managed to somehow surround myself with brilliant BI developers (and Chris) where they take my ideas (code that is usually held together with Duct tape and bubblegum) and turn it into art.  I have the extreme pleasure of being able to work with clients on a daily basis, helping them get the most out of their Cognos BI.  Maybe I'm starting to believe this "Edge" stuff!

We're really excited about sharing what we're up to with you.  We have some really cool stuff coming out of the labs, and we've decided to quit being our own best kept secret. 


1 Comments Click here to read/write comments

All Posts