I have problem with f:ajax tag. I want to show and hide some data after click on commandLink but i get error:

My code:
<h:form prependId="false" id="contactDataForm">
<h:commandLink value="Edit" action="#{cc.attrs.userBB.showHideEditForm()}">
<f:ajax render="editableContactData notEditableContactData"/>
</h:commandLink>
<h:panelGroup id="notEditableContactData" rendered="#{cc.attrs.userBB.show == false}">
test1
</h:panelGroup>
test2
</h:panelGroup>
</h:form>
I think the errors that you are getting is cause you are trying to refer to elements that are not rendered from your
f:ajax, instead : refer to the wrappers ofh:panelGroupthat may or may not be renderedWrap the
notEditableContactData, so basically :try to change
into
do the same for the other
h:panelGrouptootake a look at this answer of mine Can you update an h:outputLabel from a p:ajax listener?