IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
No replies
1959 Posts

Pinned topic Cascaded prompts and javascript

‏2013-02-12T07:16:26Z |
XPosted to Cognoise:,21033.0.html

Broke my forehead on this wall already, must be missing something fairly obvious.

I have following requirement:
  • user selects month from the prompt
  • depending on user's selection, version prompt contents are refreshed (display values stay the same, use values change). Basically, I'm picking correct “Latest Forecast for month” version based on month. Potential caveat is that I'm picking version use values from TM1.

Base set up of version prompt cascaded from month one poses 2 problems:
  • version selection is dropped to default every time you change month (that is logical, since “use value” changes when months change)
  • previous “use values” are used for filtering, so until you reselect version or month 2 times, you can't be 100% sure what version you're seeing

I thought about obvious variant of static version prompt with display values (they don't change) and making another “use value” version prompt, that will leave only selected version from static prompt and using javascript to automatically submit this single version.

This works up to the point of “submitting” version, I see that correct single version is selected in “use values” version prompt, but paramValue and paramDisplayValue are empty for this prompt. If I either run the report (play button) or press Reprompt button, they show up. I can't find a way to achieve this via Javascript ( promptAction( 'reprompt' ) / /promptAction('finish'); don't work).
Any help / ideas would be appreciated.

I'm attaching a couple of screens to show what's happening:
1) I'm selecting static version of Latest Forecast and use value version prompt picks up selection properly, but promptValue and promptDisplayValue are empty
2) From the 1), I either press run or Reprompt button — promptValue and promptDisplayValue show up correctly
Javascript I'm using:

<script type=
"text/javascript"> function init() 
{ var fW = (typeof getFormWarpRequest == 
"function" ? getFormWarpRequest() : document.forms[

if ( !fW || fW == undefined) 
{ fW = ( formWarpRequest_THIS_ ? formWarpRequest_THIS_ : formWarpRequest_NS_ );

if (fW) var list = fW._oLstChoicesPrompt_Scenario; list.options[2].selected=

true; canSubmitPrompt(); 
} init();   </script>