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

Cognos Custom Control.prototype.getParameters

Started by jems2021, 20 Jan 2021 06:36:38 PM

Previous topic - Next topic

jems2021

I am a newbie.  I have two parameters I am trying to set from js file.  The following is my custom control configuration:

{
    "Button label": "Employee",
    "Button value": "Employee ID",
    "Button Height": "40px",
    "Button Width": "200px",
    "Parameter": "paramEmp",
    "Parameter2": "paramLst",
    "lstValue": "Employee",
    "Background Color": "#4178BE",
    "Font Color": "#ffffff",
    "Font Family": "Arial",
    "Font Size": "10pt"
}

My getParameters function is:
Control.prototype.getParameters = function (oControlHost) {

      return [
      {
         "parameter": oControlHost.configuration["Parameter"],
         "values": [ {
            "use" :  oControlHost.configuration["Button value"], "display" : oControlHost.configuration["Button label"]
         }]
      }
      {
         "parameter: oControlHost.configuration["Parameter2"],
         "values": [ {
            "use" :  oControlHost.configuration["lstValue"], "display" : oControlHost.configuration["lstValue"]
         }]
      }
      ];
   };

I am getting the error below when I run the report:
SyntaxError: Unexpected token '{'

It looks to me that all tokens are paired.  What am I missing?

Please help.  Thanks.
===================
Made the following modification for Parameter2 and the error went away.  However, Parameter2 is not being updated in the report.
   Control.prototype.getParameters = function (oControlHost) {

      return [
      {
         "parameter": oControlHost.configuration["Parameter"],
         "values": [ {
            "use" :  oControlHost.configuration["Button value"], "display" : oControlHost.configuration["Button label"]
         }],
         "parameter": oControlHost.configuration["Parameter2"],
          "values": [{
            "use" : oControlHost.configuration["lstValue"]
         }]

      
      
      }
      
      ];
   };

   Control.prototype.f_onClick = function (oControlHost) {
      oControlHost.valueChanged();
      oControlHost.next();
   };

   return Control;

Why is Parameter2 not being updated in the report?
Thanks for your help.

jems2021


MFGF

Quote from: jems2021 on 22 Jan 2021 10:02:04 AM
@dougp  Please take a look.

Hi,

It's not really appropriate to instruct another forum member to answer your questions. People who provide guidance and assistance here do so of their own free will, and out of a desire to help others where they can. I understand that you're keen to have answers, but please be mindful that other members are under no obligation to respond, and individuals might feel taken for granted if pushed to answer like this. My experience is that these sorts of messages can have the opposite effect to the outcome you're hoping for, and can dissuade an individual from responding. In short, please be courteous to other forum members.

MF.
Meep!

dougp

Right away I see syntax errors in both versions.  I haven't actually worked in the bowels of the IBM Cognos Scriptable Reports API for months, so I can't tell at a glance if there are logic problems.

jems2021