5 Replies Latest reply on May 16, 2007 6:20 AM by Ilya Shaikovsky

    I have problems with a4j:repeat / ui:repeat + rich:toolBar +

    Thai Dang Vu Apprentice

      Environment: java 1.6, a4j & richfaces from richfaces 3.0.1 RC2, facelets 1.1.12, jsf ri 1.2_04_p1

      This is my bean:

      public class TestStuffPiece1 {
       private List<DropDownMenu> dropDownMenus = new ArrayList<DropDownMenu>();
      
       public TestStuffPiece1() {
       dropDownMenus.add(new DropDownMenu("File"));
       dropDownMenus.add(new DropDownMenu("View"));
       }
      
       public List<DropDownMenu> getDropDownMenus() {
       return dropDownMenus;
       }
      
       public void setDropDownMenus(List<DropDownMenu> dropDownMenus) {
       this.dropDownMenus = dropDownMenus;
       }
      }

      DropDownMenu.java:
      public class DropDownMenu {
       private String value;
      
       public DropDownMenu(String value) {
       this.value = value;
       }
      
       public String getValue() {
       return value;
       }
      }

      My xhtml file:
      <rich:toolBar>
       <a4j:repeat value="#{testStuffPiece1.dropDownMenus}" var="dropDownMenu">
       <rich:dropDownMenu value="#{dropDownMenu.value}">
       <rich:menuItem value="Open ..." action="a" />
       <rich:menuItem value="Save ..." action="a" />
       <rich:menuSeparator />
       <rich:menuItem value="Exit" action="a" />
       </rich:dropDownMenu>
       </a4j:repeat>
      </rich:toolBar>
      This code causes the File and View menu vertically aligned.
      But everything is fine (File and View meny are horizontally aligned) if I replace that a4j:repeat line with
      <rich:toolBar>
       <rich:dropDownMenu value="File">
       <rich:menuItem value="Open ..." action="a" />
       <rich:menuItem value="Save ..." action="a" />
       <rich:menuSeparator />
       <rich:menuItem value="Exit" action="a" />
       </rich:dropDownMenu>
       <rich:dropDownMenu value="View">
       <rich:menuItem value="Open ..." action="a" />
       <rich:menuItem value="Save ..." action="a" />
       <rich:menuSeparator />
       <rich:menuItem value="Exit" action="a" />
       </rich:dropDownMenu>
      </rich:toolBar>

      So, what's the problem here?