I have problem in getting a value of previous added rows in a async table using the Add(in built )

Hi Experts,

-> i have an async table

-> i have three columns in that table and first column is a dropdown with 8 choices

-> adding the rows using the add action(in built).

I have problem in getting the value from the drop down that exists in first column of async table for the rows which was added and i have a requirement of get the values from the drop down of the previous added rows and get those choices indexes and hide those choices from the drop down for the newly added records, since i am failed to get the newly value from the drop down of the previous rows, iam not able to get the index and not able to hide those options from the drop down for the newly added rows.

Below is the code i have return , but unfortunately not worked.

i have placed the below code on the add action button of on click event (using custom script controll)
---------------------code-------------------------------

var settlementParties = CAF.model("#{activePageBean.clientIds[‘settlementParties’]}").list()
var settlementPartiesRowID = “#{activePageBean.clientIds[‘settlementParties’]}”+":__row"
//var dropDownOptionValue;
for (i=settlementParties.length-1;i>=0;i++)
{

var baseRowId = settlementPartiesRowID+settlementParties[i]+":"
var settDropDown = baseRowId+“settlementPartiesDD”;
var settlementPartyValue=CAF.model(baseRowId+“settlementPartiesDD”).getValue();// this is my drop down name ----------settlementPartiesDD------------

var indexValue;
switch(settlementPartyValue){
case (settlementPartyValue = “A”):
indexValue=“1”;
alert(">>>>>>>>>>>"+indexValue);
break;

                case (settlementPartyValue = "B"):
                 indexValue="2";
                break;

                case (settlementPartyValue = "C"):
                 indexValue="3";
                break;

                case (settlementPartyValue = "D"):
                 indexValue="4";
                break;

                case (settlementPartyValue = "E"):
                 indexValue="5";
                break;

                case (settlementPartyValue = "F"):
                 indexValue="6";
                break;
                
                 case (settlementPartyValue = "G"):
                 indexValue="7";
                break;

                case (settlementPartyValue = "H"):
                 indexValue="8";
                break;
                
                }
                
                optionValueDisabled(indexValue);

}

function optionValueDisabled(indexVal){
alert(">>>>>>>>>> Index value passed from "+indexVal); // here i am getting as undefined.

dropDownOptionValue.options[indexVal].style.visibility=“hidden”;
}

--------------------------------------code--------------------------------------
FYI,
unfortunately, though i have more than one record it was going in the for loop only once, still surprising what happened to my rows in the async table.

Please help me to move forward on the above issue.

FYI, i am using the 9.5 version.

Thanks in Advance.

For client side code, you would want to use the getControlId method from the row model to get a control inside of a row.

For example, something like this:


//resolve the table model by id
var settlementParties = CAF.model(#{caf:cid('settlementParties')});

//loop through the rows
var rows = settlementParties.list();
for(var i=0; i < rows.length; i++) {
    var row = rows[i];

    //resolve the id of a control in the row from its local id
    var settDropDownId = row.getControlId("settlementPartiesDD");

    //debug logging
    console.log("settDropDownId is: " + settDropDownId);

    //get the model for the dropdown
    var settDropDown = CAF.model(settDropDownId);

    //and the value from the model
    var value = settDropDown.getValue();

    //debug logging
    console.log("value is: " + value);    
}