I have a table with rows with th:fields, everything works OK.
I need to add new rows, so I did it with javascript but when I submit the form those new rows are not submited. Do I need a special magic for that?
th:field="*{configuredProperties[__${iterator.index}__].propertyType}"
Thanks!
edited: I create a row like this:
function addProperty() {
var rows = $('#propertiesTable tbody tr');
var row = rows[0];
var clone = row.cloneNode(true);
clone.getElementsByTagName('input')[0].value = null;
clone.getElementsByTagName('input')[1].value = null;
clone.getElementsByTagName('input')[2].value = null;
var lastRow = rows[rows.length - 1];
var newId = parseInt(lastRow.getAttribute("id")) + 1;
clone.id = newId;
var link = $(clone).find('#removeProperty')[0];
link.setAttribute('onclick', 'removeProperty(' + newId + ')');
var propertyType = $(clone).find('#propertyType')[0];
propertyType.setAttribute('name', '*{configuredProperties[' + newId + '].propertyType');
var propertyName = $(clone).find('#propertyName')[0];
propertyName.setAttribute('name', '*{configuredProperties[' + newId + '].propertyName');
var defaultValue = $(clone).find('#defaultValue')[0];
defaultValue.setAttribute('name', '*{configuredProperties[' + newId + '].defaultValue');
var tbody = $('#propertiesTable tbody')[0];
tbody.appendChild(clone);
}