UPDATE:
It seems like this problem only occurs in Internet Explorer. Here is a sample code demonstrating the issue:
<html>
<body>
<SPAN id=selectOperacion class=x2j>
<INPUT onclick="return confirm('testing');" type=radio name=selectOperacion id=selectOperacion:_0>
<LABEL title=Loan for=selectOperacion:_0>Loan</LABEL>
<INPUT onclick="return confirm('testing');" type=radio name=selectOperacion id=selectOperacion:_1>
<LABEL title="Material Transfer" for=selectOperacion:_1>Material Transfer</LABEL></SPAN>
</body>
</html>
Original post:
I have defined two radio buttons using Apache Trinidad as follows:
<tr:selectOneRadio id="selectOperacion"
value="#{myBean.operacion}"
autoSubmit="true"
valueChangeListener="#{myBean.myChangeListener}"
onclick="return confirm('test');" >
<f:selectItems value="#{myBean.options}" />
</tr:selectOneRadio>
This code generates two radio input elements.
The problem arises when the user clicks "Cancel" on the confirm dialog, causing both radio buttons to become unselected.
Is there a way to maintain the selected state of the radio button even if confirm() returns false?
Thank you in advance.