IC SunsetThe developerWorks Connections platform will be sunset on December 31, 2019. On January 1, 2020, this forum will no longer be available. More details available on our FAQ.
Topic
  • 3 replies
  • Latest Post - ‏2019-07-16T15:56:28Z by rise_ag
bpmanalyst
bpmanalyst
19 Posts

Pinned topic Dynamically Populate the dropdown on the basis of another dropdown

‏2018-05-02T13:20:48Z |

Hello everyone,

I'm using IBM BPM 8.6 and what is wish to do is I want to populate the dropdown let's say package on the basis of selection of another dropdown let's say Project.

Though the issue is very trivial, but I think I'm missing somewhere. So my approach is in the configuration option of Package dropdown, I'm populating the data as per the screenshot attached. 

This is the code of my service flow(ajax service) below. 

data and results input, output variables of both of type any. The problem is that inside the block whenever it is going it is not able to set the data. However the objects are getting created. and if I initialise the results BO outside any block the list is getting populated but then it will not be dynamic.

 

Any help on above will be appreciated.

 

Thanks

 

//log.info("Choosing packages with package id - " +tw.local.data);



tw.local.results = new tw.object.listOf.NameValuePair();


tw.local.results[0] = new tw.object.NameValuePair(); 

tw.local.results[1] = new tw.object.NameValuePair();

tw.local.results[2] = new tw.object.NameValuePair();

tw.local.results[3] = new tw.object.NameValuePair();



if(tw.local.data=="PRJ000")

{


tw.local.results[0].name= "PKG001";

tw.local.results[0].value = "PACKAGE 001";


tw.local.results[1].name = "PKG002";

tw.local.results[1].value = "PACKAGE 002";


tw.local.results[2].name = "PKG003";

tw.local.results[2].value = "PACKAGE 003";


tw.local.results[3].name = "PKG004";

tw.local.results[3].value = "PACKAGE 004";

tw.local.results.listAddSelected(0);

}


else if(tw.local.data=="PRJ001")

{

tw.local.results[0].name = "PKG005";

tw.local.results[0].value = "PACKAGE 005";

tw.local.results[1].name = "PKG006";

tw.local.results[1].value = "PACKAGE 006";

tw.local.results[2].name = "PKG007";

tw.local.results[2].value = "PACKAGE 007";

tw.local.results[3].name = "PKG008";

tw.local.results[3].value = "PACKAGE 008";

tw.local.results.listAddSelected(0);

}


else if(tw.local.data=="PRJ002")

{

tw.local.results[0].name = "PKG009";

tw.local.results[0].value = "PACKAGE 009";

tw.local.results[1].name = "PKG0010";

tw.local.results[1].value = "PACKAGE 0010";

tw.local.results[2].name = "PKG0011";

tw.local.results[2].value = "PACKAGE 0011";

tw.local.results[3].name = "PKG0012";

tw.local.results[3].value = "PACKAGE 0012";

tw.local.results.listAddSelected(0);

}

else if(tw.local.data=="PRJ003")

{

tw.local.results[0].name = "PKG0013";

tw.local.results[0].value = "PACKAGE 0013";

tw.local.results[1].name = "PKG0014";

tw.local.results[1].value = "PACKAGE 0014";

tw.local.results[2].name = "PKG0015";

tw.local.results[2].value = "PACKAGE 0015";

tw.local.results[3].name = "PKG0016";

tw.local.results[3].value = "PACKAGE 0016";

tw.local.results.listAddSelected(0);

}

else if(tw.local.data=="PRJ004")

{

tw.local.results[0].name = "PKG0017";

tw.local.results[0].value = "PACKAGE 0017";

tw.local.results[1].name = "PKG0018";

tw.local.results[1].value = "PACKAGE 0018";

tw.local.results[2].name = "PKG0019";

tw.local.results[2].value = "PACKAGE 0019";

tw.local.results[3].name = "PKG0020";

tw.local.results[3].value = "PACKAGE 0020";

tw.local.results.listAddSelected(0);

}
  • bpmanalyst
    bpmanalyst
    19 Posts

    Re: Dynamically Populate the dropdown on the basis of another dropdown

    ‏2018-05-02T13:41:37Z  

    So this came to my knowledge that the condition that I'm giving in if-else isn't letting the control go inside the block. Any thoughts on this data is of type any and I am checking it with a string type.

     

    Thanks

     

  • bpmanalyst
    bpmanalyst
    19 Posts

    Re: Dynamically Populate the dropdown on the basis of another dropdown

    ‏2018-05-10T04:50:48Z  

    So this came to my knowledge that the condition that I'm giving in if-else isn't letting the control go inside the block. Any thoughts on this data is of type any and I am checking it with a string type.

     

    Thanks

     

    This came to my knowledge that the project.name is not setting while selecting from dropdown any thoughts on this?

  • rise_ag
    rise_ag
    24 Posts

    Re: Dynamically Populate the dropdown on the basis of another dropdown

    ‏2019-07-16T15:56:28Z  

    This came to my knowledge that the project.name is not setting while selecting from dropdown any thoughts on this?

    id try to pass the service input data as a string variable (not a complex object).also, i did this a while back but try using an AJAX service to fill the list items