<h:outputLinkvalue="#">Show</h:outputLink><rich:panelid="code"><!-- O código fonte q vc quer mostra vem aqui --></rich:panel><rich:effectname="showCode"for="code"type="BlindDown"/><rich:effectname="hideCode"for="code"type="BlindUp"/><scripttype="javascript"><![CDATA[ var codeStatus = 0; // 0 p/ oculto e 1 p/ visível. function toggleCode(link) { switch (codeStatus) { case 0: showCode(); link.text = "Hide"; codeStatus = 1; break; case 1: hideCode(); link.text = "Show"; codeStatus = 0; break; } }]]></script>
Eu ñ sou exatamente “brilhante” no javascript então podem haver alguns erros ai e precisem ser corrigidos. O uso de jQuery tb pode ajudar um pouco, embora seja típicamente trabalhoso de usar jQuery em scripts em projetos q usam RichFaces.