rerendering problem
sathishavunoori May 25, 2010 8:18 AMhi to all,
i have a problem while using <a4j:commandButton>,that is ,
i have a <h:form> consisting of one <h:outpuText> field and one <rich:dataTable> and two buttons as <a4j:commadButton> for adding and deletion new row into the table . The code is as follows,
<h:form styleClass="association" id="voyageCarriersChildren">
<h:outputText id="noContacts" value="There are no Contacts" rendered="#{vesselContacts.rowCount==0}"/>
<div id="detailList" >
<rich:dataTable id="vesselContactListTable" var="_vesselContact" selectedClass="selection"
selectionMode="single" width="800px"
value="#{vesselContacts}" headerClass="removeheader" rendered="#{vesselContacts.rowCount>0}" >
<rich:column id="contactPerson" width="190px"
headerClass="head" label="#{messages['com.infyz.toms.properties.Vessel_name']}">
<f:facet name="header">
<h:outputText styleClass="headerText" value="#{messages['com.infyz.toms.properties.Vessel_name']}" />
</f:facet>
<rich:inplaceInput layout="block"
value="#{_vesselContact.contactPerson}"
changedHoverClass="hover" viewHoverClass="hover"
viewClass="inplace" changedClass="inplace" selectOnEdit="true"
editEvent="onclick">
<a4j:support event="onviewactivated" reRender="contactPerson" />
</rich:inplaceInput>
</rich:column >---------------------
some columns
---------------------
</rich:dataTable>
</div>
<rich:spacer height="15"/>
<div align="right">
<a4j:commandButton id="editVoyageReferenceMP11"
action="#{vesselAction.addVesselContact}"
reRender="vesselContactListTable,voyageCarriersChildren,noContacts"
oncomplete="if (#{facesContext.maximumSeverity!=null}) #{rich:component('vesselEditWizard')}.show();"
value="#{messages['com.infyz.toms.label.button.tooltip.Add']} #{messages['com.infyz.toms.properties.Contact']}" />
 
<a4j:commandButton bypassUpdates="true" immediate="true" value="#messages['com.infyz.toms.label.button.tooltip.Cancel']}"
reRender="vesselContactListTable,voyageCarriersChildren,noContacts" action="#{vesselAction.cancelVesselContact}" />
</div>
</h:form>
My requirement is that , when i click on add button one new object will be added to the list of the dataTable and rerender the table with newly added object, if i click on cancel button the newly added object should be deleted from the list and datatable will be rerendered. if no objects are there in list then <h:outputText > field should be displayed with "There are no contacts " text and the datatable will be disabled.But when i clicking on the buttons either on add or on cancel the rerender of output text and table not happening.
Can any one help me where i am doing wrong?
Thanks in advance for your concern