Issue: I came across this situation while trying to add row of select boxes to a table in a JSP page upon clicking an AddRow button. The 'select' boxes should be populated with some model data(jsp data) received from Spring's controller. I am able to add the row of select boxes to the table using jQuery but unable to use the JSP data to the select boxes.
Solution: After searching various solutions on internet, I finalized on 2 methods:
Method 1: Set the JSP data to a html element and read the data inside jQuery and use it.
Method 2: Go for ajax calls in jQuery to fetch data from controller every time you need to populate the select boxes.
Solution: After searching various solutions on internet, I finalized on 2 methods:
Method 1: Set the JSP data to a html element and read the data inside jQuery and use it.
Method 2: Go for ajax calls in jQuery to fetch data from controller every time you need to populate the select boxes.
No comments:
Post a Comment