I have a Map fetched from a database and I want to use the data to populate Select box. The Map is added to the model using sellerCodeList
In Spring it is simple:
<form:select path="orderDetails[0].SellerItemCode" items="${sellerCodeList}">
</form:select>
But I want to use the same in a Jquery function which builds up my select box. (Reason: I have a table with dynamic rows and each row has a select box as one of the element)
When I use the following I start getting error/exception
$("#poFields").append('<tr valign="top"><td>
<form:select path="orderDetails['+rowNum+'].SellerItemCode" items="${sellerCodeList}">
</form:select>');
This throws an exception
I see on SO that there is a way to iterate over the sellerCodeList and feed to options as per the following Dropdown link from SO
I am not good with JSON stuff though ;-)
Can someone please help