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

 

Clearing the selected values, stored in Parameter names - Select n Search prompt

Started by cognosun, 05 Mar 2017 03:44:23 AM

Previous topic - Next topic

cognosun

We are using Cognos 10.2.1

We need to auto-submit values from a Select and Search prompt, as we don't have Auto-submit property for Select and Search prompt we are using Javascript for submitting values to the child prompt.

What we've observed is, Cognos is not clearing pre-selected values from the Select and Search prompt, which is causing lot of issues, while user is selecting and searching multiple times.

My question is, how to clear the values which cognos stores (caches) in it's Parameter names(either as a feature, or by using JS).

I saw many unanswered blogs on this....

CognosPaul

I'm not exactly following what you need it to do. By pre-selected, do you mean a static value?

Can you give me an example work flow? User searches for Product "TrailChef Water Bag", then changes his mind and searches for "Star Lite", is "TrailChef Water Bag" still selected? Is the user removing the first value before searching for the next?

cognosun

Hi Paul, let me explain you...

In a Prompt page....we have 2 radio buttons in a simple value prompt with static choices (1,2), 1->displays text box prompt // 2->displays 'select and search' prompt:

Functionality:
--------------

I click on first radio button ( from above prompt) and I get 'Text box' prompt for manually keying-in Region ID values

1) I'll give Region ID in the Text box and clicks on Reprompt button
2) I'll get the related country names in a seperate value prompt ( cascading from textbox value) -- parameter name of this value prompt is ?p_country?


------------------

Now I click on the second radio button, which shows me Select and Search prompt ( hide and show JS script I've used).

1) I'll search for a Country Name and click on Search
2) I'll get my search results -- parameter name of this 'select and search' prompt is ?p_country?
3) As there is no Auto-Submit property for 'Select and Search' prompt, i've applied on-change/submit functions using JS
4) User clicks on one of the search result , which is, any 'country name', and he'll get a new value prompt box underneath it, displaying City names in that country - CASCADING from 'select and search' prompt USING JS.

-------------

So in above two scenarios I'm using same parameter name for country name, i.e. ?p_country?

THIS IS BECAUSE I NEED TO PASS THIS UNIQUE PARAMETER AS INPUT, TO CALL A PLSQL FUNCTION FROM COGNOS, WHERE USER SELECTS "ONLY ONE COUNTRY NAME IN EITHER OF THE SCENARIOS".


Problem:
---------

If I use same parameter name for two prompt controls, values are getting cached and I'm getting strange results, or always single result.

In Select and Search prompt, first search is working fine, but second search is always giving me cached first value, in the search result...and I'm finding is impossible to find any JS stuff to clear old values on every click of 'Search'.

CognosPaul

Can you create and attach a quick example report (using the samples if you have, if not it's easy to switch the data items)? I think I see the problem, but I'd like to play with it directly.

cognosun

Hi Paul,

Thanks for you reply.

Below are the functions i'm using in JS, which are not clearing pre-cachded parameter values from Select and Search prompt.
----------------
var a=oCR.prompt.getControlByName("SearchName");
vbb.clearValues();
vcc.clearValues();
a.clearValues();
---------------
Many Thanks