简体   繁体   中英

Date Prompt in Cognos Report

I'm a Cognos Developer and I'm having a trouble about "Date Prompts". I have a "Date Prompt" with the option "Edit box" selected in the "Select UI" and I want when the user change the chosen date an "onchange" event fires. Now I'm using JavaScript functions but I'm not getting do this... and just the "onchange" event don't work. I tested with another events like "onclick" and them work. My code:

<script>

var fW = (typeof getFormWarpRequest == "function" ?getFormWarpRequest() : document.forms["formWarpRequest"]);

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

fW.txtDateCALENDARIO.onchange= function() { alert('Test'); }

</script>

In this sample I want that always the user change their choices the message "Test" is shown. Today if the user choose for example "July 29, 2013" the event is not fired, but if the user change manually on the "Edit Box" for "July 28, 2013" and click in another place, the event is fired!!!

Could anyone help me? Please?

Thanks!!

I suggest add jQuery ( http://jquery.com ) and then you can handle several events easier.

You can see how to do that here:

http://www.ibm.com/developerworks/library/ba-pp-reporting-advanced-report-design-page647/index.html?ca=drs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM