I'm sandboxing a simple text/control visibility scenario that behaves very similarly to rich:togglePanel but am having some conceptual issues in how links/buttons work - I think I just fail to understand how and when objects are added to the DOM tree, especially with the rendered attribute.
<a4j:outputPanel id="panel" layout="inline">
<h:panelGroup rendered="#{!TestBean.showButton}">
<a4j:commandLink value="Show Details" actionListener="#{TestBean.displayButton}" reRender="panel" immediate="true" />
</h:panelGroup>
<h:panelGroup rendered="#{TestBean.showButton}">
<h:outputText value="Click to hide details. " />
<a4j:commandButton value="Hide" actionListener="#{TestBean.resetButton}" reRender="panel" immediate="true" />
</h:panelGroup>
</a4j:outputPanel>
Apologies, didn't realize I posted into a closed forum.
Reposted: http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4185212#4185212