Tuesday, 27 August 2013

java ee ajax bind selected radio buttons to controller

java ee ajax bind selected radio buttons to controller

i have a html table:
<table>
<tr>
<td>Connection</td>
<td>Action</td>
</tr>
<tr>
<td>On</td>
<td>
<input type"radio" checked="checked" value="0"
name="rs[0].selection"> off
<input type"radio" checked="checked" value="1"
name="rs[0].selection"> on
</td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="btnSubmit" text="submit"
/></td>
</tr>
</table>
i implemented a ajax polling to constantly update the data on this page.
what happen in the controller is it will get the data from database, set
it to the object and return it to the jstl view page.
here is the problem im encountering: - Connection is off, radio button
"off" is checked - i clicked radio button "on". - before i could click
submit, the ajax kicks in. when this happen, it updates the page and the
radio button "off" is checked.
how can i keep the radio button "on" checked??

No comments:

Post a Comment