1 Reply Latest reply on May 10, 2012 3:14 PM by Brian Leathem

    Radiobuttons changing place?

    P Alcove Newbie

      Hy,

      my Radiobuttons behave very strange:

      When I select a Radiobutton the "before selected" One and the "newly selected" One

      change places. So I thought ok maybe my items List is changing but it isnt...

      Another thing I do not understand is why there is any rerender?

      (Ajax works and there is only one POST request to change the itemValue)

      Tanks for help

       

      <h:panelGroup id="linktypenradio"
          rendered="#{FormBean2.requiredDimensionsContain12}">
          <h:selectOneRadio id="linktypes"  
              value="#{FormBean2.t013DmLinktyp}" layout="pageDirection">
              <c:forEach items="#{FormBean2.linktypen}" var="linktyp">
                  <c:choose>
                      <c:when
                          test="#{linktyp.t013Id == FormBean2.t013DmLinktyp}">
                          <f:selectItem itemLabel="#{linktyp.t013Linktyp}"
                              itemValue="#{linktyp.t013Id}" checked="checked" />
                      </c:when>
                      <c:otherwise>
                          <f:selectItem itemLabel="#{linktyp.t013Linktyp}"
                              itemValue="#{linktyp.t013Id}" />
                      </c:otherwise>
                  </c:choose>
              </c:forEach>
              <a4j:ajax ajaxSingle="true" event="change"/>
          </h:selectOneRadio>
      </h:panelGroup>
      
        • 1. Re: Radiobuttons changing place?
          Brian Leathem Master

          Be careful with the JSTL tags (c:*).  They are evaluated at the time the component tree is built, not when the component is rendered.  They can be effective for improvoing performance by pruning the component tree, but should not be used in cases where the result can change throughout the lifecycle of a request.  try using a panelGroup with your condition in a renderer attribute instead.