Pergunta

I have two radio sets and one is dependent on the other. I want to disable the second one when there is a specified change in first one. I have used a4j:support tag to accomplish it as shown in the code below

<td align="left">
<h:selectOneRadio value="#{wcbBean.wcbVO.IS_UNABLE_TO_PERFORM}">
<f:selectItem itemValue="1" itemLabel="Yes" />
<f:selectItem itemValue="0" itemLabel="No" />
<a4j:support event="onchange" action="#{wcbBean.setDegImpairState}" reRender="rbDegImpair">
</a4j:support>
</h:selectOneRadio>         
</td>
<td align="right">Degree of Impairment:</td>
<td align="left">
<h:selectOneRadio id="rbDegImpair" value="#{wcbBean.wcbVO.DEGREE_OF_IMPAIRMENT}" disabled="#{wcbBean.wcbVO.DISABLE_DEGREE_IMPAIR}">
<f:selectItem itemValue="TOTAL" itemLabel="TOTAL" />
<f:selectItem itemValue="PARTIAL" itemLabel="PARTIAL" />
</h:selectOneRadio>         
</td>   

The second set is not rendering again on changing the first set but after a single click anywhere on the page. Why I need to click on the page to disable the second set?

Foi útil?

Solução

The reason of the above problem was IE need another click to fire the onchange event while the code runs fine in firefox. To make it work in IE, I simply change the onchange event to onclick event and now I dont need any extra click.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top