8 Replies Latest reply on Oct 9, 2007 6:51 AM by Yurii Kartsev

    h selectOneRadio+a4j support - reRender onChange possible?

    Yurii Kartsev Apprentice

      Is this possible? As you see, I need to display different input fields depending on radio selection. If this solution is possible - then it doesn't work to me... why? If it isn't possible, then please advise me on possible solutions... I see only this one or simple JScript onChange + page refresh. Is there something better?

      <h:form id="registerNewWorker">
      
      ...
      
       <h:panelGroup>
       <h:selectOneRadio id="salaryType_radio" value="#{amBean.employee.isSalaryMonth}">
       <f:selectItem itemLabel="Monthly" itemValue="1"/>
       <f:selectItem itemLabel="Hourly" itemValue="0"/>
       <a4j:support event="onChange" reRender=":registerNewWorker_form"/>
       </h:selectOneRadio>
       </h:panelGroup>
      
       <c:if test="#{amBean.employee.isSalaryMonth==1}">
       <h:panelGroup>
       <font color="red">*</font>
       <h:outputText value="Salary per month" />
       </h:panelGroup>
      
       <h:panelGroup>
       <h:inputText id="salPerMonthEdit" required="true" value="#{amBean.employee.salaryMonth}" />
       <rich:message style="color: red" for="salPerMonthEdit"/>
       </h:panelGroup>
       </c:if>
      
       <c:if test="#{amBean.employee.isSalaryMonth==0}">
       <h:panelGroup>
       <font color="red">*</font>
       <h:outputText value="Salary per hour" />
       </h:panelGroup>
      
       <h:panelGroup>
       <h:inputText id="salPerHourEdit" required="true" value="#{amBean.employee.salaryHour}" />
       <rich:message style="color: red" for="salPerHourEdit"/>
       </h:panelGroup>
       </c:if>
      
      ...
      
      </h:form>



      Thanks in advance.