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

Java script not working on prompt page

Started by sumeir, 05 Jan 2010 07:54:23 AM

Previous topic - Next topic

sumeir

Hi Gurus,

I am using the following java script to have the Project Manager list box prompt unselected. By default it is coming like "Project manager name" in the first line then a "line" and then an "empty line" and then all project managers displays. I tried to remove if (selectedEmpty) list.options[0].selected = true; however it's still selecting first row in the value prompt. I want none of the rows should be selected in the value prompt. Using the following java script I can hide first three rows but it's selecting first row when actual manager names starts.

Example of the prompt how it is coming:
Project Manager
-----------------------

Ajay
Malik
Neha
Padma

Example of the expected prompt:
Ajay
Malik
Neha
Padma

Java script follows:

<script language="javascript">
function selectedEmptyFunction(o)
{
  var retVal= false;
for (i=0; i < o.options.length; i++)
{
  if (o.options.selected && (o.options.value == null || o.options.value == "")) {retVal = true; break;}
}
return retVal;
}
</script>


<script language="javascript">
      var fW = (typeof getFormWarpRequest == "function" ? getFormWarpRequest() : document.forms["formWarpRequest"]);
       if ( !fW || fW == undefined) { fW = ( formWarpRequest_THIS_ ? formWarpRequest_THIS_ : formWarpRequest_NS_ );}
       var list = fW._oLstChoicespm;
       var selectedEmpty = selectedEmptyFunction(list); // Check to see if this is the first time in...
       list.remove(2);
       list.remove(1);
       list.remove(0);
       list.removeAttribute("hasLabel");
       if (selectedEmpty) list.options[0].selected = true;
       listBoxpm.checkData();
</script>

Please advice!!

Thanks in Advance

Sumeir

Sreeni P

Hi sumeir,

it's very simple as it seen ............try this one....

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

fW._oLstChoices<prompt name>.remove(0);
fW._oLstChoices<prompt name>.remove(0);

</script>


<prompt name> = Set the prompt name from properties


Hope this will fix ur problem