Hi,
<h:commandButton type="reset" /> will reset to previous values and not clear the values. So we have to reset to null in the backing bean as follows:
<h
anelGrid styleClass="alignLeft">
<h:commandButton type="submit" value="Clear"
styleClass="commandExButton" id="id2"
actionListener="#{searchAgreement.clear}" />
</h
anelGrid>
/**
* Action Listener method for clear action
*
* @param eActionEvent
*/
public void clear(ActionEvent e) {
FacesContext facesContext = FacesContext.getCurrentInstance();
UIViewRoot uiViewRoot = facesContext.getViewRoot();
HtmlInputText inputText = null;
inputText = (HtmlInputText) uiViewRoot.findComponent("searchAgreement:agreementNumber");
inputText.setValue("");
inputText = (HtmlInputText) uiViewRoot.findComponent("searchAgreement:customerName");
inputText.setValue("");
inputText = (HtmlInputText) uiViewRoot.findComponent("searchAgreement:customerRefNumber");
inputText.setValue("");
inputText = (HtmlInputText) uiViewRoot.findComponent("searchAgreement:customerNumber");
inputText.setValue("");
inputText = (HtmlInputText) uiViewRoot.findComponent("searchAgreement:contactPhoneNumber");
inputText.setValue("");
}
hope this helps
Prakash