File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Help me about html:select Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Help me about html:select" Watch "Help me about html:select" New topic

Help me about html:select

johny nam

Joined: Aug 15, 2008
Posts: 1
i have a table. when you select a record on the table it will bind data to textbox and combobox but it is only bind data to textbox and not bind to combobox.
please help me.
this is my code in jsp file
<form action="Action/" method="post" enctype="multipart/form-data" name="form1" id="form1">
<table width="500" border="1">
<td width="974" height="38"><div align="center" class="style1"> City Informations </div></td>
<td><table width="660" border="1">
<td width="114" bgcolor="#999999"><div align="center">City ID </div></td>
<td width="197" bgcolor="#999999"><div align="center">City Name </div></td>
<td width="149" bgcolor="#999999"><div align="center">Country ID </div></td>
<td width="187" bgcolor="#999999"><div align="center">Decriptions</div></td>
<td width="187" bgcolor="#999999"><div align="center">Delete</div></td>
<logic:iterate id="list" name="cityActionForm" property="cityList">
<td align="center">
<a href="Action/<bean:write name="list" property="cityId"/>&action=select"><bean:write name="list" property="cityId"/></a>
<td align="center"><bean:write name="list" property="cityName"/></td>
<td align="center"><bean:write name="list" property="countryID"/></td>
<td align="center"><bean:write name="list" property="descriptions"/></td>
<td align="center">
<a href="Action/<bean:write name="list" property="cityId"/>&action=delete">delete</a>

<table width="669" border="1">
<td><div align="right">City ID : </div></td>
<td colspan="2"><input type="text" name="cityId" value="<bean:write name="cityActionForm" property="cityId"/>" /></td>
<td width="119"><div align="right">Country : </div></td>
<td width="252">Here
it is not bind data when i select row from above table. it alway show the first record from list
<select name="countryID">
<logic:iterate id="list" name="cityActionForm" property="countryList">
<option value="<bean:write name="list" property="countryID"/>">
<bean:write name="list" property="countryName"/>
<td><div align="right">City Name : </div></td>
<td colspan="2"><input type="text" name="cityName" value="<bean:write name="cityActionForm" property="cityName"/>" /></td>
<td width="119" rowspan="2"><div align="right">Descriptions : </div></td>
<td width="252" rowspan="2"><input type="text" name="descriptions" value="<bean:write name="cityActionForm" property="descriptions"/>" /></td>
<td colspan="3"> </td>

<td colspan="3">
<div align="right">
<input name="btNew" type="reset" id="btNew" value="Reset" />
<td colspan="2">
<div align="left">
<input type="submit" id="btInsert" value=" OK " name="btInsert"/>
<p> </p>

please tell me when have you have answer.
I agree. Here's the link:
subject: Help me about html:select
It's not a secret anymore!