Cognos Analytics

 View Only
  • 1.  JS Example to handle click events using page module

    Posted Mon April 01, 2019 06:26 AM
    Hi everybody,
    i need some help with js using a page module control in  cognos analytics.
    I'have a prompt page with two date prompts, a start Date and end Date .
    I would like to check start date prompt values and set end date prompts values and also visibility.
    example situation:
    f the month of start date prompt is current month then after the click my end date will be disabled or get hidden and the queiry doesn't take in consideration the end date parameter.
    when the selected month of start date prompt is not equal to current month,
    my end date prompt will be automatically set to the end of chosen month.

    How to do this with js and page module ?
    thanks for your help and suggestions.

    ------------------------------
    Leonardo Russo
    ------------------------------

    #CognosAnalyticswithWatson


  • 2.  RE: JS Example to handle click events using page module

    Posted Mon April 01, 2019 11:44 AM

    Hey Leonardo,

    Have a look at the below link, I think it would be a good starting point to get you going. If you run into issues reply back to this thread.


    https://www.cornerstone.com.au/blog/custom-javascript-in-cognos-analytics-date-prompts-and-datasets



    ------------------------------
    DENNY NAREZNY
    ------------------------------



  • 3.  RE: JS Example to handle click events using page module

    Posted Mon April 01, 2019 02:48 PM
    thank you Danny,i've some problem to understand this js code.it's complicated for my poor level of expertise with javascript language.
    i have understood that for my case it's better to use custom control module. But...
    on cornerstone blog js script i don't realize when the setValidator function appears in the code and reuse the fromval variable as a parameter.
    What  is  it doing?could someone explain in very simple way that passage in the script?
    It is a callback?
    Thanks

    ctrl.setValidator(fromVal);         









    ------------------------------
    Leonardo Russo
    ------------------------------