tieredMenu is not working in JSF 2.1 component library does not contain such component
<p>I am using JSF 2.1 in my project. I have created menu dynamically. When I use <code>menuBar</code> it works but when I change it to <code>tieredMenu</code> it gives an error: </p>

<blockquote>
  <p>The component library <a href="http://primefaces.org/ui" rel="nofollow noreferrer">http://primefaces.org/ui</a> does not contain such component </p>
</blockquote>

<p>My xhtml code is below:</p>

<pre><code>&lt;p:layoutUnit position="west" size="300" header="Hide me" resizable="false" closable="false" collapsible="true" style="font-weight: bold; width: 500px;"&gt;
      &lt;h:form &gt;

          &lt;p:tieredMenu  model="#{menuCreator.model}" style="font-size: 14px; font-weight: bold; color: #000000; position: absolute;"/&gt; 

      &lt;/h:form&gt;
&lt;/p:layoutUnit&gt;   
</code></pre>

<p>And my backend bean is below:</p>

<pre><code>public MenuCreator() {
    model = new DefaultMenuModel();
    Gateway_RoleDetail gwRoleDetail = new Gateway_RoleDetail();
    List&lt;RoleDetail&gt; lstRoleDetail = new ArrayList&lt;RoleDetail&gt;();
 //  List&lt;RoleDetail&gt; lstRoleDetail2 = new ArrayList&lt;RoleDetail&gt;();
    FacesContext facesContext = FacesContext.getCurrentInstance();
    Logininfo logininfo = (Logininfo) facesContext.getApplication().createValueBinding("#{logininfo}").getValue(facesContext);

    lstRoleDetail = gwRoleDetail.getRoleDetail(logininfo.getUserType());
    Iterator itrRole = lstRoleDetail.iterator();
    RoleDetail roleDetail, roleDetailInter,roleDetailsubMenu;

    String group_name = "";
    String rolename = "";
     while (itrRole.hasNext()) {
        roleDetail = (RoleDetail) itrRole.next();

        if (!group_name.equals(roleDetail.getGroup_name())) {

            group_name = roleDetail.getGroup_name();
            Submenu submenu = new Submenu();

            submenu.setLabel(group_name);

            Iterator itrInterlist = lstRoleDetail.iterator();
            while (itrInterlist.hasNext()) {
                roleDetailInter = (RoleDetail) itrInterlist.next();
                if (group_name.equals(roleDetailInter.getGroup_name())) {
                   if(!roleDetailInter.getRole_function_JSF().equals("1")) {
                      MenuItem item = new MenuItem();
                      item.setValue(roleDetailInter.getRole_name());
                      item.setUrl(roleDetailInter.getRole_function_JSF());
                      submenu.getChildren().add(item);
                   }
                   else if(roleDetailInter.getRole_function_JSF().equals("1")) {
                        MenuItem item = new MenuItem();
                        Submenu submenu1 = new Submenu();
                        submenu1.setLabel(roleDetailInter.getRole_name());
                        item = new MenuItem();
                        item.setValue("CPU");
                        item.setUrl("checkList.xhtml");
                        submenu1.getChildren().add(item);
                        item = new MenuItem();
                        item.setValue("Monitor");
                        item.setUrl("monitorCheckList.xhtml");
                        submenu1.getChildren().add(item);
                        item = new MenuItem();
                        item.setValue("Printer");
                        item.setUrl("printerCheckList.xhtml");
                        submenu1.getChildren().add(item);
                        submenu.getChildren().add(submenu1);                
                    }
                }
             }
             model.addSubmenu(submenu);
         }
     }
}
</code></pre>

<p>Please give me a solution.</p>