COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Universe09 on 18 Mar 2009 09:02:14 PM

Title: renaming parameter name in value prompt
Post by: Universe09 on 18 Mar 2009 09:02:14 PM
hi,

I tried using HTML item to rename a parameter name in a value using this javascript

<script>
   document.formWarpRequest._oLstChoicesXXX[0].text = 'My own text';
</script>

where the XXX is the name of the value prompt, it is working when I open the report but if I will try to retrieve data the renamed parameter will go back to its original form.

how can I fix that it will always carry the customized text even I try to retrieve data?

please help me... Thanks!
Title: Re: renaming parameter name in value prompt
Post by: Sunchaser on 21 Mar 2009 06:42:55 AM
Hi,

First, "_oLstChoices" is a 8.2 syntax, so you shouldn't expect anything good in 8.3 with that.

You could try to put the code changing the "text" property of your object in a function that will be called each time the page is loaded.
May be you can take a look at this subject:

http://www.cognoise.com/community/index.php/topic,6245.0.html (http://www.cognoise.com/community/index.php/topic,6245.0.html)

and see the "body" tag (with onload, etc...).

If I correctly understand what's happening, the page is reloaded each time you retrieve datas.

If not, may be we could imagine to do a 'attachEvent("onChange", function()...etc...)' in the onload event of the body; so, everytime the prompt object is "rebuild", you could be sure that the parameter name will be changed.
But it is not a so "clean" solution, in my opinion...

Hope it could help you.
vinc.