title: How get value of tag <p:menu> in primefaces
body: <p>I am doing a web aplication where I have a menu with a list entities and this entities will be evaluated all it is in a facelets template and I now I need to get the ID of this entity to can evaluate How it do ?</p>
  
  <p>I thought it: </p>
  
  <pre><code>&lt;p:menu model="#{entidadView.menuModel}" toggleable="true"   &gt;
  
       &lt;p:ajax listener="#{grupoView.storeEntidad}"/&gt;
  
  &lt;/p:menu&gt;
  </code></pre>
  
  <p>and My bean it is:</p>
  
  <pre><code>public MenuModel getMenuModel(){
  DefaultSubMenu subMenu2 = new DefaultSubMenu("Auditoria");
      for (Entidad entidad : getAllEntidad() ){
          item = new DefaultMenuItem(entidad.getNombre());
          item.setOutcome("/auditar.xhtml");    
          subMenu2.addElement(item);
      }
  
      model.addElement(subMenu2);
  
   //Event to Ajax
  public void  storeEntidad(ValueChangeEvent evento){
  
      this.idEntidad = evento.getNewValue().toString();;
      System.out.println(idEntidad);
  
   }
  </code></pre>
  
  <p>but say me this error:</p>
  
  <pre><code> &lt;p:ajax&gt; Unable to attach behavior to non-ClientBehaviorHolder parent
  </code></pre>