COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Sundaramoorthy on 12 Apr 2016 10:07:58 AM

Title: Need your help
Post by: Sundaramoorthy on 12 Apr 2016 10:07:58 AM
Hi All,

As per the business requirement, we need to use check box option for selecting multiple values within the prompt. But as by default, we will not have auto submit option for this type of UI prompt. But in order to achieve few scenario like until we click on reprompt button which is related to that check box prompt, finish button should not need to be enabled..

Could anybody please throw some light on this..

Thanks in advance..
Title: Re: Need your help
Post by: BigChris on 12 Apr 2016 10:20:29 AM
You can't have auto submit if you're going to have multi-selections.
Title: Re: Need your help
Post by: Sundaramoorthy on 13 Apr 2016 08:54:13 PM
Bigchris,

Thanks for your prompt response. Is there any way to achieve it using java scripts
Title: Re: Need your help
Post by: BigChris on 14 Apr 2016 02:20:39 AM
I imagine there is, but I'm afraid I don't use JavaScript at all. There's always the risk that it'll break as soon as Cognos is updated
Title: Re: Need your help
Post by: Lynn on 14 Apr 2016 02:41:21 AM
This is a requirement I never can understand although it comes up often enough.

How do you know when the user has completed making his or her selections? The amount of time required to select will vary from user to user. The number of options selected can vary from user to user and run to run for the same user. It is a very vague requirement unless there are some specifics that outline the user experience in this regard.

I don't see how you can code for it otherwise no matter how much javascript you write. That javascript, by the way, may well be utterly worthless when you upgrade to a later version of the software. And all of that to save the precious user from having to click a submit button. Seriously?

As developers we can either blindly follow requirements set out by business users and business analysts and attempt to implement no matter how ridiculous .... or we can engage in a conversation to understand the intent of the requirement and work together to find the ideal approach. It could be that the person who defined your requirements would realize the impossibility of what they've requested if you just point out the obvious.
Title: Re: Need your help
Post by: BigChris on 14 Apr 2016 02:55:59 AM
If I understand your requirement Sundaramoorthy, there needs to be a step of clicking the Reprompt button before the Finish button is available? Is that right?

I'm guessing there are other prompts on your page and they use the values from the first prompt to get their values...is that the case? If you make the second prompt required that would force a selection to be made before the Finish button can be pressed.

My only other suggestion would be to play around with render variables, probably based on ParamDisplayValue(?YourFirstPrompt?). You might be able to put the finish button in conditional rendered box and only show it when a value has been selected.
Title: Re: Need your help
Post by: MFGF on 14 Apr 2016 03:24:05 AM
Quote from: Lynn on 14 Apr 2016 02:41:21 AM
This is a requirement I never can understand although it comes up often enough.

How do you know when the user has completed making his or her selections? The amount of time required to select will vary from user to user. The number of options selected can vary from user to user and run to run for the same user. It is a very vague requirement unless there are some specifics that outline the user experience in this regard.

I don't see how you can code for it otherwise no matter how much javascript you write. That javascript, by the way, may well be utterly worthless when you upgrade to a later version of the software. And all of that to save the precious user from having to click a submit button. Seriously?

As developers we can either blindly follow requirements set out by business users and business analysts and attempt to implement no matter how ridiculous .... or we can engage in a conversation to understand the intent of the requirement and work together to find the ideal approach. It could be that the person who defined your requirements would realize the impossibility of what they've requested if you just point out the obvious.

One of my colleagues had an excellent idea here. Two mice - one for each hand. You could then multi-select two items simultaneously. The problem comes when you want to select more than two - I haven't yet seen a mouse designed for use by the foot...

:)

MF.
Title: Re: Need your help
Post by: Sundaramoorthy on 14 Apr 2016 11:29:06 AM
Thank you all for your comments.i too agree that it is not feasible on paper but thought of checking with experts like you people..

Will let you know if i found any solution for this issue..
Title: Re: Need your help
Post by: Sundaramoorthy on 15 Apr 2016 09:13:45 AM
I have successfully implemented the above said logic by using java scripts..
Title: Re: Need your help
Post by: navissar on 15 Apr 2016 09:35:12 AM
Quote from: Lynn on 14 Apr 2016 02:41:21 AM
This is a requirement I never can understand although it comes up often enough.

How do you know when the user has completed making his or her selections? The amount of time required to select will vary from user to user. The number of options selected can vary from user to user and run to run for the same user. It is a very vague requirement unless there are some specifics that outline the user experience in this regard.

I don't see how you can code for it otherwise no matter how much javascript you write. That javascript, by the way, may well be utterly worthless when you upgrade to a later version of the software. And all of that to save the precious user from having to click a submit button. Seriously?

As developers we can either blindly follow requirements set out by business users and business analysts and attempt to implement no matter how ridiculous .... or we can engage in a conversation to understand the intent of the requirement and work together to find the ideal approach. It could be that the person who defined your requirements would realize the impossibility of what they've requested if you just point out the obvious.

Lynn is right, of course.
Having said that, I will say I implemented this in the past, by defining a rectangular area around the prompt element on triggering a reprompt on mouse out of that area. This went on to production so probably wasn't a bad idea, although I agree that it's not perfect.
I will also say that with Prompt API (Which is an IBM documented feature) you can at least be sure that for the next version your code is upgrade-proof, and that there are ways of upgrade proofing java script, in some cases.
Title: Re: Need your help
Post by: MFGF on 15 Apr 2016 09:52:40 AM
Quote from: Nimrod Avissar on 15 Apr 2016 09:35:12 AM
I will also say that with Prompt API (Which is an IBM documented feature) you can at least be sure that for the next version your code is upgrade-proof, and that there are ways of upgrade proofing java script, in some cases.

Just bear in mind that within Cognos Analytics (Cognos 11), java script doesn't run when the report viewer is set to interactive mode (which is the default when authoring new reports). You need it to be the old non-interactive report viewer. Makes no difference whether you use the prompt API or not - it won't run for interactive reports.

Cheers!

MF.
Title: Re: Need your help
Post by: navissar on 15 Apr 2016 09:57:22 AM
True that. Doesn't make a lot of sense to use prompts traditionally with a dynamic viewer. The report authored with Prompt API, however, will not break (It'll just use the old viewer).
Title: Re: Need your help
Post by: Lynn on 15 Apr 2016 10:29:04 AM
Quote from: Nimrod Avissar on 15 Apr 2016 09:35:12 AM
Lynn is right, of course.
Having said that, I will say I implemented this in the past, by defining a rectangular area around the prompt element on triggering a reprompt on mouse out of that area. This went on to production so probably wasn't a bad idea, although I agree that it's not perfect.
I will also say that with Prompt API (Which is an IBM documented feature) you can at least be sure that for the next version your code is upgrade-proof, and that there are ways of upgrade proofing java script, in some cases.

I knew there were java script solutions out there but the main point of my rant was that some definition of how to trigger the submit was missing from the requirement. The idea of triggering it upon moving the mouse out is a sensible approach to code for. The OP didn't mention what approach he took in solving the problem, just that it was solved. That won't be especially useful to someone else who comes along later after searching for the same thing. At least your response will help point someone in the right direction.