Rajagopal Mani wrote:Hi,
Welcome to JavaRanch.
Hope below code snippets may help you.
In JSP
Hi Rajagopal thanks for you reply but i've solved, i has something like this
every TR is the rappresentation of different bean ex. tr_0 = bean at index 0, tr_1 = bean at index 1 ... and so on..
the user can change one o more inputs value of one o more tr, after save in the combo fields must be selected the new value.
something like html <option value="value"
selected="selected" >item 1</option>
ex.
//before user's changes
and so on...
//after user's changes
my tryed in this way:
in the end of jsp i call js function like document.onLoad=myFunction();
myFunction(){
//with jstl
get beanCollection and iterate it
//with js
get tbody container and iterate it
match tr and bean having the same index
get all tr select fields and iterate it
if comboField.id == beanpropertyname or form-bean property(it's the same) set values //i think this step is not elegant because i must know what property i need to get//
comboField.value = <c:out value="${bean.property}"/>
}
it works fine
Alex