If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Forcing Value Prompt to auto submit

Started by markryan, 20 Apr 2009 02:48:02 PM

Previous topic - Next topic

markryan

I have a particular scenario that I haven't found any code examples for yet.

We two prompts, one cascades from the other.  So the first one is set to auto-submit and when the selection is changed, the second one refreshes.  The first prompt contains Fiscal Periods.

What we need to do is select the last fiscal period by default when the prompt page loads.  so I used some simple enough javascript I found to test this by setting the selected index.

var theSpan = document.getElementById("PeriodSpan");
var theSelect = theSpan.getElementsByTagName("select");

if(theSelect[0].options.selectedIndex == -1)
{
    theSelect[0].options[12].selected=true; // the index 12 will be replaced by a dynamic value once I get this portion to work.
}


The problem I'm having is that while this does select the value when the page loads, if a value isn't already selected, it does not auto-submit and populate the second prompt.

I've looked at the javascript includes to see if I could figure out what Cognos is doing, but I haven't found anything that works yet.

So I need to be able to have a default selection on the first prompt, based on dynamic data, and have that cascade and populate the second prompt.

Any takers?

Thanks