3 Replies Latest reply on Apr 3, 2008 4:55 AM by jvarma

    Form doesn't get refreshed

    jvarma

      Hi,

      I am new user of Ajax4jsf rich faces. I am trying to work out whether it can be used in an existing project done uding JSF(myfaces 1.1.3).I have downloaded richfaces3.1.4 into my project.
      I am using a4j:support in a drop down list of a data table. According to the value change of the drop down I need to display a check box . Here is my code:

      JSP:

      <t:dataTable id="workData" value="#{DefineQuoteBean.workQtDetail}" var="wkQtDetail"
      border="0" columnClasses="deptColm,"
      preserveDataModel="false" rowGroupStyle="border-bottom:gold;border-bottom-style:solid;
      border-bottom-width:2px;vertical-align:top" style="width:100%">
      <t:column>
      <f:facet name="header">
      <h:outputText id="vt" value="#{msg.vat}" />
      </f:facet> <a4j:region>
      <h:selectOneMenu id="vat" value="#{wkQtDetail.vat}"
      disabled="#{DefineQuoteBean.readonly}"
      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.changeSelection}" reRender="outputselectonemenu" >
      </a4j:support>
      </h:selectOneMenu> </a4j:region>
      </t:column>
      </t:dataTable>
      
      <a4j:outputPanel ajaxRendered="true" id="outputselectonemenu">
      <h:selectBooleanCheckbox id="displayVat" value="#{DefineQuoteBean.displayVat}"
      rendered="#{DefineQuoteBean.renderDispVat}" valueChangeListener = "#{DefineQuoteBean.changeSelection}"
       onclick="submit();"/> </a4j:outputPanel>
      


      Bean:

      
      public void changeSelection(javax.faces.event.ActionEvent event) throws ServiceException{
       //code for turn on the check box and command button
       Logger.getLog().debug("Changed ! ! ! : "+this.qtNo);
       }
      


      My Problem :

      When the value of the drop down changed, it executes the action event and 'Changed!!!' and the value being diplayed. But the check box doesn't displayed. I don't want the whole form to be reloaded. I just want the checkbox to be dosplayed without getting refreshed the rest of the page.

      Can anyone tell me how can I solve this problem ?

      Thanks,
      JVarma