2 Replies Latest reply on Nov 29, 2008 11:46 AM by msznapka

    ajaxSingle in repeat bug

    msznapka

      Hello
      I want to report a bug with ajaxSingle inside repeat, here is the code:

      <a4j:commandLink action="#{hello.increaseCounter}" reRender="ajaxOutputPanel" ajaxSingle="true">firstlink</a4j:commandLink>
      <ui:repeat value="#{hello.list}" var="item">
       <a4j:commandLink action="#{hello.increaseCounter}" reRender="ajaxOutputPanel" ajaxSingle="true">link#{item}</a4j:commandLink>
      </ui:repeat>
      
      <a4j:outputPanel id="ajaxOutputPanel">
       #{hello.counter}
      </a4j:outputPanel>


      @Name("hello")
      @Scope(ScopeType.APPLICATION)
      @Startup
      public class Hello {
      
       private List<Integer> list;
       private int counter;
      
       @Create
       public void create() {
       list = Arrays.asList(2,3);
       counter = 0;
       }
      
       public void increaseCounter() {
       counter++;
       }
      
       public List<Integer> getList() {
       return list;
       }
      
       public int getCounter() {
       return counter;
       }
      
      }


      If you are clicking on the first link, than everything works. if you are clicking on the links inside repeat, than it is not working as expected.

      If this example runs on richfaces 3.1.X, than everything work correctly. On the other hand, richfaces 3.2.X have the bug described above.

      You can try example .

        • 1. Re: ajaxSingle in repeat bug
          nbelaevski

          Hi,

          That happens because ui:repeat is JSF 1.1 compatible and doesn't implement javax.faces.component.UIComponent#invokeOnComponent(FacesContext, String, ContextCallback) method in the right way.

          Use a4j:repeat instead.

          • 2. Re: ajaxSingle in repeat bug
            msznapka

            Thx for solution, it is working fine with a4j:repeat.

            I thought it is richfaces bug, because my example was working with version 3.1.x, but not with 3.2.x.