COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: gosoccer on 02 Apr 2014 11:48:55 AM

Title: Disabling a Text Item in Report Author 10.1.2
Post by: gosoccer on 02 Apr 2014 11:48:55 AM
Folks,
I am trying to write the JS code to disable a text item in my report.

I'm running Cognos Report 10.1.2 and based on the user's selection on a "value prompt",
I need to disable this text item that is not part of the value prompt.  It is a TEXT ITEM called
"SELECTED" under the properties and Misc Name

Thx so much. :D
Title: Re: Disabling a Text Item in Report Author 10.1.2
Post by: Waydin2296 on 02 Apr 2014 09:55:27 PM
Quote from: gosoccer on 02 Apr 2014 11:48:55 AM
Folks,
I am trying to write the JS code to disable a text item in my report.

I'm running Cognos Report 10.1.2 and based on the user's selection on a "value prompt",
I need to disable this text item that is not part of the value prompt.  It is a TEXT ITEM called
"SELECTED" under the properties and Misc Name
Instead of javascript, have you tried using a conditional style or a render variable to handle this
Title: Re: Disabling a Text Item in Report Author 10.1.2
Post by: gosoccer on 03 Apr 2014 07:46:57 AM
Waydin,

Based on an invaluable help from Nimrod, I am using get Element and other JS techniques to disable to "Value Prompt"
document.getElementById("snsPr").getElementsByTagName("select")[0];

I didn't know the rendering or conditional styling would help? Do you by any chance have an example?

Thx in advance for your time.
Title: Re: Disabling a Text Item in Report Author 10.1.2
Post by: gosoccer on 20 May 2014 07:21:15 AM
Waydinn,
Sorry for opening a previous help.
Did you ever figure out how to disable a text item. I am stuck on this too.

I tried the following but it is not doing anything at all.

Set a name to the text Field. Under properties->Miscelaneous->Name Lets say you name it "foo"

The below short JS code disables the text field.
With this you should be able to implement you own logic for disabling/enabling

<script>
fw=getFormWarpRequest();
fw._textEditBoxfoo.disabled=true;
</script>

Thank you in advance for your time.
Title: Re: Disabling a Text Item in Report Author 10.1.2
Post by: navissar on 20 May 2014 07:28:29 AM
I hardly think two threads are in order here.
Title: Re: Disabling a Text Item in Report Author 10.1.2
Post by: MFGF on 20 May 2014 11:56:37 AM
Quote from: Nimrod Avissar on 20 May 2014 07:28:29 AM
I hardly think two threads are in order here.

Agreed. Gosoccer, why did you start a separate thread when you already have one asking this same question?

I'm closing this thread and any further responses can be added to the original:

http://www.cognoise.com/index.php/topic,24868.0.html

MF.