This content has been marked as final.
Show 2 replies
-
1. Re: rendering and hiding a panel
monkeyden Apr 27, 2011 10:46 AM (in response to angela)Sure there is. Generally, I would add the a4j:support tag to the component responsible for making an AJAX request (i.e. changing the condition), adding
reRender
to the tag to tell RichFaces which components to reRender after the response. If the condition was changed on the request, the reRendered components will be hidden/shown based on that condition. Use therendered
attribute on the components that are conditionally rendered.<!-- The "controlling" component --> <h:selectOneListbox id="myPropertySelect" value="#{myBean.myProperty}" size="1" > <s:selectItems value="#{myBean.myProperties}".../> <a4j:support ajaxSingle="true" event="onchange" reRender="propertyNotSelected,propertySelectedPanel" /> </h:selectOneListbox> ... <!-- Render when myProperty has NOT been selected --> <a4j:outputPanel id="propertyNotSelectedPanel" rendered="#{myBean.myProperty empty}"> <h:outputText value="Please choose a myProperty"/> </a4j:outputPanel> <!-- Render when myProperty has been selected --> <a4j:outputPanel id="propertySelectedPanel" rendered="#{myBean.myProperty not empty}"> <h:outputText value="myProperty selected"/> </a4j:outputPanel>
Untested code, but you probably get the idea. Hope it helps.
-
2. Re: rendering and hiding a panel
angela Apr 27, 2011 5:25 PM (in response to angela)Hello Kyle!!
This is exactly what I was searching for!!!Thank you very much