COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: venkiatmaruthi on 08 Dec 2010 02:48:26 AM

Title: value prompt's value changing
Post by: venkiatmaruthi on 08 Dec 2010 02:48:26 AM
Hi,

I have value prompt contain YEARMONTH.

Dev created a javascript to set this prompt value to 201012. Developer created init() to get that yeardate and calling that in
Quote<Body onload=init()>
Now the problem is__
1) user selects some other value in that prompt say eg. 201004
2) if the page refreshes the prompt value becoming 201012 again instead of 201004

I want 201004 even after the page refreshes

How could I achieve this?
Title: Re: value prompt's value changing
Post by: CognosPaul on 08 Dec 2010 03:05:24 AM
You have an HTML item on the page that triggers that JavaScript function. Every time the page is refreshed, if the HTML item is still on the page it will still trigger. What you need to do is to find a way to render the HTML item only when the paramValue is null.

Click on the HTML item that contains the init(). In the properties there is a row called "Render Variable". Click on the ellipse (...) for that row and select New Boolean Variable. Call it renderInit. The expression should be paramValue('YEARMONTH') is null (assuming YEARMONTH is the name of your parameter).

When the parameter is null, the HTML item will render, triggering the JavaScript. If the user selects a value the Boolean will resolve to false, and the HTML will not render.
Title: [RESOLVED] value prompt's value changing
Post by: venkiatmaruthi on 08 Dec 2010 03:28:51 AM
Thanks a lot PaulM

Its working.