I work with Struts2 , Hibernate3 and jpa I have 3 tables:
1 Evaluationglobale (id_eval ,label) 2 SousEval(id_eval ,id_sousitem), 3 SousItems(id_sousitem ,label)
How do I add a record into SousEval? i want to use the last insert ID in table Evaluationglobale for insert meny record into SousEval that i recupere this record from SousItems
I have that
Code:
id_eval label
----------------------------
1 evaluation 1
id_sousitem SousItem_Libelle
----------------------------
1 sousitem 1
2 sousitem 2
3 sousitem 3
4 sousitem 4
i want insert somthing like that
Code:
id_eval id_sousitem
----------------------------
1 1
1 2
1 3
1 4
And I don't know how to recuper all id_sousitem from iterator from this jsp :
Code:
<form action="saveOrupdateSousEval" method="post">
<TABLE class="EvalTable" >
<s:iterator value="item" status="userStatus">
<s:select label="%{Item_Libelle}"
headerValue="---------------- Select ---------------"
headerKey="-1"
name="sousEvalItem.SousItem_ID"
list="sousitem"
listKey="sousitem.SousItem_ID"
listValue="SousItem_Libelle"
cssClass="tdLabelwidht"
value="%{SousItem_ID}"
id="EvalTable" />
</s:iterator>
</TABLE>
<s:texfield type=hidden value="%{id_eval}" name="id_eval" />
</form>