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

Javascript function should be applied only on default run

Started by inu, 25 Sep 2017 12:36:44 PM

Previous topic - Next topic

inu

Hi,

I created a date prompt and used javascript function to set the default set, it works fine. When we change the date and click the Finish button date is applied to the filter perfectly,  but same default date is set again in the date prompt.
I know the reason because whenever we click the finish button whole page is refreshed and date prompt also set as default date.
e-g i set default date as 20-jun-2017 it displays when we run the report first time, that's fine for me. On further if i select another date say 30-Sept-2017 and click the Finish button, in query filter it is applied correctly as 30-Sept-2017, but in the date prompt  20-jun-2017 displays.
that's the issue.
Default date should display only once when we run the report, and on proceeding date prompt should display as per user selection.
Please put some light on it and share the idea.


Thanks.
Inma

rockytopmark

Put a render variable on the Javascript HTML Item, so it only "Renders" when the parameter is not set

inu

Quote from: rockytopmark on 05 Oct 2017 11:49:03 AM
Put a render variable on the Javascript HTML Item, so it only "Renders" when the parameter is not set
I found the solution, in the same js code Add onions property under body tag. 

Blue

I don't like the "add onions" property - too smelly!
Robert Edis
Principal
Robert Edis Consulting
Rotorua, New Zealand

inu

Quote from: Blue on 09 Oct 2017 04:55:22 PM
I don't like the "add onions" property - too smelly!
Typing mistake... Onload property

rockytopmark

if the user selected to re-prompt (re-loading the prompt page), wouldn't that trigger the OnLoad() again essentially replacing the user's selection with the default one again?