a4j:repeat / ui:repeat not working with rich:toolbar and rich:dropDownMenu
--------------------------------------------------------------------------

                 Key: RF-10203
                 URL: https://issues.jboss.org/browse/RF-10203
             Project: RichFaces
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: component-menu
    Affects Versions: 4.0.0.Milestone5
         Environment: Windows Vista Build 6001
apache-tomcat-7.0.5
Sun jdk1.6.0_14
RichFaces 4.0.0.20101226-M5
Mojarra JSF 2.0.3-FCS 
            Reporter: Karl Mueller


Hi I was trying this :

                <rich:toolbar height="26px">
                        <a4j:repeat value="#{menuBean.menuGroups}" 
var="menuGroup">
                                <rich:dropDownMenu mode="ajax">
                                        <f:facet name="label">
                        <h:outputText value="#{menuGroup.menuName}" />
                </f:facet>
                        <a4j:repeat value="#{menuGroup.menuElements}" 
var="menuElement">
                                <rich:menuItem label="#{menuElement.label}" 
action="#{menuElement.targetURL}" />
                        </a4j:repeat>
                                </rich:dropDownMenu>
                        </rich:toolBarGroup>
                        </a4j:repeat>
                </rich:toolbar>

The outer repeat works, but creates 2 menus which are stacked above each 
other.The inner repeat is not processed at all. (I have added a log statement 
to the getMethods, therefore I know that they never get called at all.)

The behavior does not change when swapping a4j:repeat with ui:repeat.


When trying this the inner repeat is processed as expected.

                <a4j:repeat value="#{menuBean.menuGroups}" var="menuGroup">
                        <h:outputText value="#{menuGroup.menuName}" />
                        <ui:repeat value="#{menuGroup.menuElements}" 
var="menuElement">
                                <h:outputText value="#{menuElement.label}"  />
                        </ui:repeat>
                        </a4j:repeat>

So is this a bug or rather a case of menu tags misusage ?


My backingBeans look like this:
(sry, but I do not have the permission to attach files)


@ManagedBean(name="menuBean")
@SessionScoped
public class MenuBean {

    private List<MenuGroup> menuGroups = new ArrayList<MenuGroup>();

    //TODO Remove hard coded menus
    public MenuBean(){
        System.out.println(">>I AM!<<");
        init();
    }


    private void init(){
        //FIXME
        MenuGroup m1 = new MenuGroup();
        m1.setMenuName("Sysadmin");

        MenuElement element = new MenuElement();
        element.setLabel("Key");
        element.setTargetURL("/sysadmin/key/key.xhtml");
        m1.getMenuElements().add(element);
        menuGroups.add(m1);

        MenuGroup m2 = new MenuGroup();
        m2.setMenuName("Test");

        element = new MenuElement();
        element.setLabel("Kontext");
        element.setTargetURL("/temp/temp_context.xhtml");
        m2.getMenuElements().add(element);

        menuGroups.add(m2);
    }
    /**
     * @return the menuGroups
     */
    public List<MenuGroup> getMenuGroups() {
        return menuGroups;
    }


    /**
     * @param menuGroups the menuGroups to set
     */
    public void setMenuGroups(List<MenuGroup> menuGroups) {
        this.menuGroups = menuGroups;
    }

}

public class MenuGroup {

    private String menuName = null;

    List<MenuElement> menuElements = new ArrayList<MenuElement>();


    /**
     * @return the menuElements
     */
    public List<MenuElement> getMenuElements() {
        return menuElements;
    }

    /**
     * @param menuElements the menuElements to set
     */
    public void setMenuElements(List<MenuElement> menuElements) {
        this.menuElements = menuElements;
    }

    /**
     * @return the menuName
     */
    public String getMenuName() {
        return menuName;
    }

    /**
     * @param menuName the menuName to set
     */
    public void setMenuName(String menuName) {
        this.menuName = menuName;
    }
}

public class MenuElement {

    private String label;
    private String targetURL;

    /**
     * @return the label
     */
    public String getLabel() {
        System.out.println(">>label>>" + label);
        return label;
    }

    /**
     * @param label the label to set
     */
    public void setLabel(String label) {
        this.label = label;
    }

    /**
     * @return the targetURL
     */
    public String getTargetURL() {
        return targetURL;
    }

    /**
     * @param targetURL the targetURL to set
     */
    public void setTargetURL(String targetURL) {
        this.targetURL = targetURL;
    }

}




-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
richfaces-issues mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/richfaces-issues

Reply via email to