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

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



      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:

       <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}" />
       <a4j:support event="onchange"
       <a4j:ajaxListener type="org.ajax4jsf.ajax.ForceRender" />
       <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}"/>
       <h:outputText id="gz" value="Family: #{init.familyStatus}"/> <!-- My test string...rerenders fine.-->

      Thanks for any help,