0 Replies Latest reply on Feb 6, 2012 5:23 AM by true_mykola

    Richfaces context menu binding doesn't work

    true_mykola

      I try to draw dynamic complex context menu, which is different for different items and can include submenus (rich:menuGroup) which can include submenus too. I don't know how to implement it using jsf tags so i've decided to make menu in bean and bind it to corresponding element on page. But there i've faced some strange problem: menu doesn't want to rerender. It is rendered only once when the page is loaded, when i try to rerender it or wrap it in a4j:output panel and rerender this panel nothing happens, my MbContextMenu.getPopupMenu() isn't called. Why?

      This is my menu:

           <h:form id="operEntriesCtxForm">
              <rich:contextMenu id="operEntriesCtxMenu" binding="#{MbContextMenu.popupMenu}"
                      disableDefaultMenu="true" submitMode="ajax" attached="false"
                      selectItemClass="selected-menu-item">
              </rich:contextMenu>
          </h:form>
      

      This is my table which triggers menu rerendering:

           <rich:extendedDataTable id="operEntriesTable" 
                  ...
                  onRowMouseDown="handleMouseClick(event)"
                  onRowMouseUp="if (showMenu(this, true)) Richfaces.showModalPanel('operEntriesCtxForm:operEntriesCtxMenu', {}, event);"
                  >
              <a4j:support event="onselectionchange" requestDelay="500"
                      reRender="operEntriesCtxForm:operEntriesCtxMenu" 
                      action="#{MbEntriesForOperation.initCtxMenu}"
                      />
              ...
          </rich:extendedDataTable>
      

      P.S. jsf 1.2, richfaces 3.3.3