My code looks like this:
<h:panelGroup id="panelA" >
<h:panelGroup id="panelB" rendered="#{!bean.editEnabled}">
<h:outputText value="#{bean.valueA}" styleClass="readOnlyBox wide hasButton" />
<a4j:commandLink title="edit" action="#{bean.setEditingModeToTrue}"
styleClass="icon edit" render="panelA">
</a4j:commandLink>
</h:panelGroup>
<h:panelGroup id="panelC" rendered="#{bean.editEnabled}">
<h:inputText value="#{bean.valueA}" styleClass="input wide" validatorMessage="Error">
<f:validateLength maximum="80"/>
<f:validateRegex pattern=".*\\<[^>]+>.*"/>
</h:inputText>
<a4j:commandLink title="save" action="#{bean.doValueSave}"
styleClass="icon save" render="panelA">
</a4j:commandLink>
</h:panelGroup>
</h:panelGroup>
Problem occurs when I click on link save. Then linked method is not called. Bean has a view scope and I guess that when I click on edit button (that is required in order to make field editable) then view state is lost so that when I click on save button nothing happends. Am I right? Is there any workaround for this problem? Bean must to have view scope... :/