-
1. Re: Displaying different panelgrids on same page
mail.micke Nov 14, 2008 10:48 AM (in response to rbhayani)Hi
You can achieve this using <a4j:support/> have a read through the implementation and look at the richfaces demo. Basically this tag allows you to do things on events, with the combo box you'll probably attach it to the onchange event (check the rich:comboBox documentation for supported events) and reRender the are you are interested in.
If you run into problems just paste the code here and we'll try to help.
Cheers,
Micke -
2. Re: Displaying different panelgrids on same page
rbhayani Nov 14, 2008 1:23 PM (in response to rbhayani)That would require some readin which I am doing already. WHat if I use radio button. Will rerender still work? Or I will need to use something else too?
-
3. Re: Displaying different panelgrids on same page
mail.micke Nov 14, 2008 1:56 PM (in response to rbhayani)<a4j:support/> works with most kinds of components.
You would still need to use <a4j:support/> if you want to trigger an ajax submit and rerender from non-button/link components.
Here is an example. When an item from the dropdown list is selected the form is submitted, a method on the backing bean is called to load some data and then finally the wrapper is rerendered and an amount is displayed instead of just a spacer.
<a4j:outputPanel id="emCollWrapper"> <rich:spacer rendered="#{empty complLimitsBacking.emColl}"/> <h:inputText id="emColl" value="#{complLimitsBacking.emColl.amountTotal}" rendered="#{!empty complLimitsBacking.emColl}" valueChangeListener="#{complLimitsBacking.valueChanged}"> <lcf:convertUnitDouble minFractionDigits="2" unit="1000000"/> <f:validateDoubleRange minimum="0"/> </h:inputText> </a4j:outputPanel> <h:selectOneMenu value="#{complLimitsBacking.emCollCountry}"> <a4j:support event="onchange" action="#{complLimitsBacking.loadEmCollSovHedgesLimitData()}" reRender="emCollWrapper"/> <s:selectItems value="#{complLimitsBacking.allCountries}" var="country" itemValue="#{country.code}" label="#{country.name}"/> </h:selectOneMenu>
Hope it helps,
Micke