COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: tamirv on 25 Sep 2011 06:29:59 AM

Title: tab indexing in cognos 10
Post by: tamirv on 25 Sep 2011 06:29:59 AM
i have prompt page with 3 value prompts.
i want that the cursor will be automatic on the middle prompt, when i click on the TAB key the cursor wiil be on the left prompt and in the next TAB the cursor will be on the right prompt

can anyone help me with this?

thank you all,
tamir
Title: Re: tab indexing in cognos 10
Post by: CognosPaul on 25 Sep 2011 08:55:36 AM
Hi Tamir,

This can only be done with JavaScript.

First, name your prompts. For example, PROMPT_NAME, PROMPT_NAME2, PROMPT_NAME3.

Second, drag in an HTML item anywhere after those three prompts, and paste the following code:
<script language="javascript">
var f = getFormWarpRequest();
var p1 = f._textEditBoxPROMPT_NAME, p2 = f._textEditBoxPROMPT_NAME2, p3 = f._textEditBoxPROMPT_NAME3;

p1.tabIndex=2;
p2.tabIndex=1;
p3.tabIndex=3;

</script>

<body onLoad="p2.focus()">


The p1, p2, p3 identify the individual prompt objects on the page. Notice the PROMPT_NAME goes immediately after the _textEditBox.

Each object is indivudally set to the correct tab order with the tabIndex property.

Finally the <body onLoad> sets the focus after the page is loaded. If you try to focus before the page is loaded you'll get a JavaScript error.
Title: Re: tab indexing in cognos 10
Post by: tamirv on 27 Sep 2011 12:45:41 AM
hi paul,
thank you for your answer.
the solution you gave me work on prompt type : text box prompt.
what about value prompt? with single-select and multi-select?

tamir.
Title: Re: tab indexing in cognos 10
Post by: CognosPaul on 27 Sep 2011 06:24:17 AM
Same idea just use _oLstChoicesPROMPT_NAME for the value prompts. There's a list of them somewhere, but I can't remember where I saw it.