• venkata narayana reddy
    April 18, 2019 at 6:08 am #5464

    Hi Team,

     

    I have scenario like,

    I have two singe select drop downs, 1st select input is based on a Ajax call(with out service input) .

    2nd select input is based on the selected drop down in the 1st single select and this input is i’m passing to a another Ajax service to show the dropdowns. but data is not populating in the 2nd single select.

    design I have followed is :

    Ajax calls input and output both are of type ANY(BAW 18.0.0.2 allowing only this configuration)

    selected dropdown in the 1st select is a name value pair.

    i’m passing the string as input to the ajax call in the 2nd select.(since input to the ajax call is string instead of any i’m unable to get the data).

    data of selected item from the 1st dropdown is name value pair, is there any way to change the data format before passing to the 2nd select ajax call.

    Please guide me how to solve the issue.

    SPARK Support
    July 23, 2019 at 10:51 am #5510

    Hi Venkata,

    You should be able to call the 2nd Single Select’s reloadServiceItems() method from the On Change event of the 1st Single Select using either the newVal argument or me.getData():

    On Change: ${Single_Select2}.reloadServiceItems(newVal);

    The service needs to implement logic based on the value provided to the data input:

    tw.local.results = new tw.object.listOf.NameValuePair;
    if (tw.local.data == “Name1”) {

    for (var i = 0; i < 5; i++) {
    tw.local.results[i] = new tw.object.NameValuePair;
    tw.local.results[i].value = “ValueXXX” + i.toString();
    tw.local.results[i].name = “NameXXX” + i.toString();
    }

    }else{

    for (var i = 0; i < 5; i++) {
    tw.local.results[i] = new tw.object.NameValuePair;
    tw.local.results[i].value = “Value” + i.toString();
    tw.local.results[i].name = “Name” + i.toString();
    }

    }

    Regards,

    Stephen P.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

Start typing and press Enter to search