If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

JS for Custom Finish Button & Deselect List Selections??

Started by torre2011, 30 Apr 2014 01:55:43 PM

Previous topic - Next topic

torre2011

I am in need of some assistance with writing a JS to first deselect user options on a multi-select list box prompt and then re-prompt the report...in that order!

I was able to track down some code used in 8.3 to deselect (seen below)..but I do not think this will still work...since I am unable to locate the P# for the list object.  Maybe it would work with the list name???

<script>
function clearAll()
{
listBox_P193373318.deSelectAll()
}
</script>


So, once I can get that code, then I need to write that into a function that can be run along with re-prompting the report from a button's onClick action.

Any ideas?


bbtresoo

Quote from: torre2011 on 30 Apr 2014 01:55:43 PM
I am in need of some assistance with writing a JS to first deselect user options on a multi-select list box prompt and then re-prompt the report...in that order!

I was able to track down some code used in 8.3 to deselect (seen below)..but I do not think this will still work...since I am unable to locate the P# for the list object.  Maybe it would work with the list name???

<script>
function clearAll()
{
listBox_P193373318.deSelectAll()
}
</script>


So, once I can get that code, then I need to write that into a function that can be run along with re-prompting the report from a button's onClick action.

Any ideas?

I am in need of some assistance with writing a JS to first deselect user options on a multi-select list box prompt please can u be more explicit? , I can't get your issue

bbtresoo



torre2011

Here is what I have, but the sequence is not working:


<script>
var list_prompts = document.getElementsByTagName("select");

function ClearSelections(){
  for (var i=0;i<list_prompts.length;i++)
  {
    list_prompts[i].selectedIndex = -1;
  }
}
</script>


<button type="button" name="repromptN13E0A580x153AED60RS"
id="repromptN13E0A580x153AED60RS" class="bp" onmouseover="this.className = 'bp bph'"
onmouseout="this.className = 'bp'" onclick="oCVRS.promptAction('reprompt');ClearSelections()"
style="color:#FFFFFF;background-color:#BE0F34"><span tabIndex="0"
style="font-weight:bold;font-size:11pt;color:#FFFFFF;" class="textItem">Submit</span></button>


Even though I wanted to target a specific List box object, this could still work for me...with the exception that once I click on the custom 'Submit' button and reprompt the page, the selections go away, and then return once all the code on the report is completely refreshed!

Is there something i can do to change the sequence???