1 Reply Latest reply on Apr 3, 2008 11:41 AM by J Varma

    outputPanel reRendering issue

    J Varma Newbie


      I am using a4j:support in selectOneMenu in a datatable. And it supposed to rerender an outputPanel contaning a checkbox and an outputText.
      Both checkbox and outputText is rendering according to a bean value.
      When onchange of selectOneMeny box, on first change it displays checkbox, and second change only it display outputText. Why is that ?
      After that the actionListener is never called !!
      Here is my code:

      <f:facet name="header">
      <h:outputText id="vt" value="#{msg.vat}" />
      <a4j:region immediate="true">
      <h:selectOneMenu id="vat" value="#{wkQtDetail.vat}"
      valueChangeListener = "#{DefineQuoteBean.changeVat}" ><%-- onchange="submit();" limitToList="true" requestDelay="3600"--%>
      <f:selectItem itemValue="none" itemLabel="Select" />
      <f:selectItem itemValue="tbc" itemLabel="TBC" />
      <f:selectItem itemValue="fullRt" itemLabel="Std Rated" />
      <f:selectItem itemValue="zero" itemLabel="Zero Rated" />
      <f:selectItem itemValue="exempt" itemLabel="Exempt" />
      <a4j:support event="onchange"
      actionListener="#{DefineQuoteBean.changeCheckboxSelection}" reRender="chkbox" > <%-- return confirm('Are you sure you want to change?') onsubmit="alert('VAT change');"--%>
      <a4j:ajaxListener type="org.ajax4jsf.ajax.ForceRender"/>
      </h:selectOneMenu> </a4j:region>
      <a4j:outputPanel ajaxRendered="true">
      <h:message for="displVt" style="color:red" />
      <a4j:outputPanel id="chkbox" ajaxRendered="true" >
      <h:panelGroup rendered="#{DefineQuoteBean.renderDispVat}">
      <h:selectBooleanCheckbox id="displayVat" value="#{DefineQuoteBean.displayVat}"
       valueChangeListener = "#{DefineQuoteBean.changeSelection}"
       onclick="submit();" />
      <h:outputText id="displVt" value="#{msg.displayVat}" />
       </h:panelGroup> </a4j:outputPanel>

      Can anybody had this problem ? Please help me... its been 2 days I am struggling to work out this.