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

Changing Default options for search and select prompt

Started by cusacjl, 11 Oct 2006 04:57:38 PM

Previous topic - Next topic

cusacjl

When you run a report with a search and select prompt, the default selection is "starts with any of these keywords".  What I want to do is when you run the report, the default selection is "contains any of these keywords".  This would eliminate the user from having to open "options" to change it. 

If any one has an idea on how to accomplish this, please let me know.

Thanks.

tyody

I am having the same issue.  I've tried using the following javascript in an HTML item but for some reason its not working.  Feel free to try it to see if it works for you:

<script>
searchUID.setOptions('on', 'off');
</script>

(Where UID is the ID of the search and select prompt).

cusacjl

Send me an email and I will give you the answer to the problem.  However, I've been warned that this solution/trick is not 'upgradeable' to C8.  Because of that, I am not planning on using the solution, but you're more than welcome to it.

John
johnlcusack@eaton.com

crossjoin

I've been using this:
<SCRIPT language="javascript">

Ã,  Ã,  Ã,  Ã,  searchFOO.setOptions('on', 'on');

</SCRIPT>


Where FOO is the ID of the search and select prompt.
wfm

Darek

Check my article on SupportLink. It should give you a good idea on how to develop an "upgradeable" solution.

But, I understand that you might be time pressed, so ..., alternatively you may put this piece of code as an HTML Item somehwere towards the end of page.

<script language="JavaScript">

for( var i=0; i<preProcessControlArray.length; i++){

var cntlName = eval(preProcessControlArray[i]);

if ( cntlName.m_oSubmit.name == 'p_First name' ){

Ã,  var s = new String(cntlName.m_sRef);

Ã,  var oIdAdvancedOptions = document.getElementById("idAdvancedOptions"+s);

Ã,  var oimgAdvancedArrow = document.getElementById("imgAdvancedArrow"+s);

Ã,  var oIdSelections = document.getElementsByName("swsOption"+s);

Ã,  oIdAdvancedOptions.style.display = "inline";

Ã,  oimgAdvancedArrow.src = "../skins/current/prompting/images/prompt_option_collapse.gif";

Ã,  if (cntlName.m_oShowOptions)

Ã,  {

Ã,  Ã,  cntlName.m_oShowOptions.value="true";

Ã,  }

Ã,  oIdSelections[2].checked="1";

Ã,  cntlName.setOptions('on','off');

Ã,  break;

}

}

</script>


Enjoy!

trooper642

I’m using the code below to change the default option to “Contains Any” the code selects the correct option but when clicking Search it returns the results of “Starts with”. But if I delete the code and select “Contains Any” manually the Search works correctly. I have the code in an HTML Item right after the Select & Search Prompt.

I’m running ver 8.1
ID = SSP

<script language="javascript">
document.all.swsMatchAny.checked="true";
searchSSP.setOptions('on', 'on');
</script>

-Bryan

jrun

Hi guys,

I had the same problem of Bryan. Darek can you explain why ? Maybe something is missing in your code.

jrun

trooper642

This code will change the default option to "Contains any of these keywords" and "SSP" is the name of the Search and Select Object.

<html>
<script type="text/javascript">
<!--
//resize SSP (InternalClientNo prompt)
document.forms("formWarpRequest")._sws_SSP_matchAnywhere.value= 'true';
document.forms("formWarpRequest")._sws_SSP_matchAll.value= 'false';
document.forms("formWarpRequest").swsOptionSSP(2).checked=true;
// -->
</script>
</html>


-Bryan

Lorilie10

What is the easiest way to change the default options for search and select prompt? Can you share it to me?




_________________
offshore staffing solutions