I have this code and I want to hide the panelGrid when i click the cancelBtn button.
<h:form id="panelSend">
<p:growl />
<h:panelGrid rendered="#{writeMessageBean.activateText}" id="panelGrid">
<p:outputLabel value="header" />
<p:inputText value="#{writeMessageBean.header}" />
<p:outputLabel/>
<p:inputTextarea value="#{writeMessageBean.text}" required="true"/>
<p:commandButton value="send" action="#{writeMessageBean.send}"
<p:commandButton id="cancelBtn" value="cancel" />
</h:panelGrid>
</h:form>
And my jquery is this.
$(document).ready(function (){
$("#panelSend\\:#panelGrid\\:#cancelBtn").click(function (){
$("#panelSend\\:#panelGrid").hide();
});
});
This doesn't work. I have tried more possibilities but it´s always the same. How can i do?