Possible bug: rich:context with rich:tree
g4j Apr 30, 2010 8:23 AMHi!
I did upgrade richfaces version. From 3.3.0 version to 3.3.3. Happens that contextmenu component (<rich:contextmenu />) doesn't works after upgrading. Sounds me a bug. I'll explain:
I have rich:tree loaded dinamically from database. I put rich:contextmenu joined with rich:tree and right-click mouse button to open the contextmenu. On version 3.3.0 all works fine. But, when i change whatever version (3.3.3, 3.3.2) the contextmenu appear and disappear rapidly.
Code:
<a4j:form id="pagina" ajaxSingle="false" ajaxSubmit="false" limitToList="true">
<rich:panel id="contextMenuPanel" bodyClass="body3" >
<f:facet name="header">
<h:outputText value="#{msg['screen.sc_secItem.label.lb_secItem']}" />
</f:facet>
<a4j:commandLink id="novoLink" action="#{secItemMBean.novoItem}" ajaxSingle="true" oncomplete="if (#{facesContext.maximumSeverity==null})#{rich:component('editContextMenuPanel')}.show();">
<h:graphicImage value="/images/icons/note_add.png" style="border:0" />
<rich:toolTip for="novoLink" value="#{msg['button.bt_Generic_add']}" />
</a4j:commandLink>
<rich:tree style="text-align: left;" switchType="ajax" id="ajaxContextMenuTree" ajaxSingle="true" ajaxSubmitSelection="true" value="#{secItemMBean.rootNode}" var="item" toggleOnClick="false">
<rich:treeNode id="node" ajaxSingle="true">
<h:outputText value="#{item.txI18nKey}" /> - <h:outputText value="#{item.id}" />
<a4j:support ajaxSingle="true" event="oncontextmenu" oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('contextTreeMenu')}.show();" limitToList="true">
<f:setPropertyActionListener value="#{item}" target="#{secItemMBean.item}" />
<f:setPropertyActionListener value="#{item}" target="#{secItemI18nMBean.item}" />
</a4j:support>
</rich:treeNode>
</rich:tree>
</rich:panel>
<rich:contextMenu submitMode="ajax" id="contextTreeMenu" attached="true" style="text-align: left;">
<rich:menuItem>
<a4j:commandLink id="createItem" action="#{secItemMBean.novoItem}" oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('editContextMenuPanel')}.show()">#{msg['screen.sc_secItem.button.bt_secItem_createItem']}</a4j:commandLink>
</rich:menuItem>
<rich:menuItem>
<a4j:commandLink action="#{secItemMBean.subItem}" oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('editContextMenuPanel')}.show()">#{msg['screen.sc_secItem.button.bt_secItem_createSubitem']}</a4j:commandLink>
</rich:menuItem>
<rich:menuItem>
<a4j:commandLink id="editLink" oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('editContextMenuPanel')}.show()">#{msg['button.bt_Generic_update']}</a4j:commandLink>
</rich:menuItem>
<rich:menuItem>
<a4j:commandLink id="editLinkConsultar" oncomplete="#{rich:component('consultContextMenuPanel')}.show()">#{msg['label.lb_Generic_consult']}</a4j:commandLink>
</rich:menuItem>
<rich:menuItem>
<a4j:commandLink id="deleteItem" oncomplete="#{rich:component('deletePanel')}.show()">#{msg['button.bt_Generic_delete']}</a4j:commandLink>
</rich:menuItem>
<rich:menuItem>
<a4j:commandLink action="#{secItemI18nMBean.novo}" oncomplete="if (#{facesContext.maximumSeverity==null})#{rich:component('editIdiomaPanel')}.show()">#{msg['screen.sc_secLanguage.label.lb_secLanguage']}</a4j:commandLink>
</rich:menuItem>
</rich:contextMenu>
</a4j:form>
Tks in advance!
Gerson.