4 Replies Latest reply on Jun 26, 2007 7:42 AM by Ilya Shaikovsky

    Trouble with a4j:support and a4j:region use (newbie)

    Greg Zoller Newbie

      Hello,

      I'm having some trouble getting support/region working properly.

      I have a pulldown menu that has a4j:support enabled and a couple of fields surrounded by a4j:region that are *supposed* to render only if the pulldown's value equals a certain value. I also have a string output text for the pulldown that I also rerender so I can see if things are working.

      My output text string rerenders properly but I can only see the conditionally rendered fields working right if I reload the page. Argh.

      Here's my code:

      <a4j:region>
       <div class="entry">
       <h:outputLabel style="width:175px" value="Family Status" for="fam" class="text_label" />
       <h:selectOneMenu class="pulldown" id="fam" value="#{init.familyStatus}">
       <s:selectItems value="#{init.familyItems}" var="item" label="#{item}" />
       <s:convertEnum/>
       <a4j:support event="onchange"
       action="#{init.clearFamily()}"
       reRender="depsDecoration,depslabel,gz">
       <a4j:ajaxListener type="org.ajax4jsf.ajax.ForceRender" />
       </a4j:support>
       </h:selectOneMenu>
      
       <h:outputText id="depslabel" value="Num. Dependents" for="deps"
       class="label text_label"
       rendered="#{init.familyStatus=='Family'}"/> <!-- Conditionals not rerendering unless I reload the page -->
       <s:decorate id="depsDecoration" rendered="#{init.familyStatus=='Family'}">
       <h:inputText id="deps" class="textfield" size="1" maxlength="1" value="#{init.numDependents}"/>
       </s:decorate>
       <h:outputText id="gz" value="Family: #{init.familyStatus}"/> <!-- My test string...rerenders fine.-->
       </div>
      </a4j:region>
      


      Thanks for any help,
      Greg