I have a jsp page with JSTL tags.The jsp page contain 2 different tab.If the user click first tab,then want to show a table with tbody contain list of values.That works fine.Now I want to change the c:forEach items when the user click the second tab.The two tab list contain same parameters with different values.So I need to change the items of c:forEach using javascript. Is this possible ?
Thanking you
In jsp
<table id="dynamic-table">
<thead>
<tr>
<th>Sl.No.</th>
<th class="sorting_disabled">Loan Id</th>
<th class="sorting_disabled">Name</th>
</tr>
</thead>
<tbody>
<c:forEach var="mainlist" items="${S1List}" varStatus="status">
<tr>
<td class="center">${status.index + 1}</td>
<td>${mainlist.loanId}</td>
<td>${mainlist.name}</td>
</tr>
</tbody>
</table>
I want to change the items="${S1List}" to items="${S2List}" using javascript
Javascript
funcion changevalueWhenSecondTabclick(){
//I want the solution code here
}