[
https://jira.jboss.org/jira/browse/RF-8607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12526995#action_12526995
]
Lukas Krejci commented on RF-8607:
----------------------------------
I found a workaround for this. Even though the code in the bug description
worked in 3.3.0.GA contextMenu show() javascript method is documented to have 2
parameters: event, context (even in 3.3.0.GA documentation and also in all the
newer versions).
Changing the code:
<a4j:support event="oncontextmenu" reRender="resourceMenu" timeout="5000"
disableDefault="true"
status="commonStatus" limitToList="true"
ajaxSingle="true">
<f:param name="contextResourceId"
value="#{resourceTreeItem.data.id}"/>
<rich:componentControl disableDefault="true"
event="oncomplete" for="resourceMenu"
operation="show" />
</a4j:support>
To:
<a4j:support event="oncontextmenu"
reRender="resourceMenu" timeout="5000"
disableDefault="true"
status="commonStatus" limitToList="true"
ajaxSingle="true"
oncomplete="#{rich:component('resourceMenu')}.show(event, {})">
<f:param name="contextResourceId"
value="#{resourceTreeItem.data.id}"/>
</a4j:support>
Solved the problem.
I'm leaving the bug open though because I believe this is still an undocumented
change in the behaviour.
> Regression in context menu on trees
> -----------------------------------
>
> Key: RF-8607
> URL: https://jira.jboss.org/jira/browse/RF-8607
> Project: RichFaces
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: component-menu, component-tree
> Affects Versions: 3.3.3.Final
> Reporter: Lukas Krejci
>
> The following code snippet illustrates how we use a context menu that is
> dynamically loaded on the oncontextmenu event. This works in 3.3.0.GA but
> stopped working in the later versions (I tried 3.3.1.GA, 3.3.2.GA, 3.3.3.CR1
> and 3.3.3.Final).
> <h:form>
> <rich:contextMenu attached="false" id="resourceMenu"
> binding="#{ResourceTreeContextMenuUIBean.menu}"
> disableDefaultMenu="false" style="z-index: 50;"
> submitMode="ajax" />
> </h:form>
> <h:form>
> <rich:tree style="width: 100%; height: 100%; min-width: 100%;
> min-height: 100%" switchType="ajax"
>
> componentState="#{ResourceTreeStateAdvisor.treeState}"
> stateAdvisor="#{ResourceTreeStateAdvisor}"
> status="commonStatus"
> var="treeNode"
> icon="/images/icn_tree_Platform.gif"
> id="leftNavTree"
> preserveDataInRequest="false"
>
> adviseNodeSelected="#{ResourceTreeStateAdvisor.adviseNodeSelected}"
>
> changeExpandListener="#{ResourceTreeStateAdvisor.changeExpandListener}"
>
> nodeSelectListener="#{ResourceTreeStateAdvisor.nodeSelectListener}"
> ajaxSubmitSelection="true"
> showConnectingLines="false"
> nodeFace="#{treeNode.data.class.simpleName}"
> eventsQueue="resourceTreeQueue"
> ignoreDupResponses="true">
> <rich:recursiveTreeNodesAdaptor
> roots="#{ResourceTreeModelUIBean.roots}"
> var="resourceTreeItem"
>
> nodes="#{resourceTreeItem.children}" />
> <rich:treeNode type="Resource"
>
> icon="/images/icons/folder_closed_#{resourceTreeItem.data.currentAvailability.availabilityType
> == 'DOWN' ? 'down' : 'up'}_16.png"
>
> iconCollapsed="/images/icons/dir_closed.png"
> iconExpanded="/images/icons/dir_open.png"
>
> iconLeaf="/images/icons/Service_#{resourceTreeItem.data.currentAvailability.availabilityType
> == 'DOWN' ? 'down' : 'up'}_16.png">
> <a4j:support event="oncontextmenu"
> reRender="resourceMenu" timeout="5000"
> disableDefault="true"
> status="commonStatus" limitToList="true"
> ajaxSingle="true">
> <f:param name="contextResourceId"
> value="#{resourceTreeItem.data.id}"/>
> <rich:componentControl disableDefault="true"
> event="oncomplete" for="resourceMenu"
> operation="show" />
> </a4j:support>
> <h:outputText value="#{resourceTreeItem}"
> styleClass="resourceLink"
> title="Right-click for more options."/>
> </rich:treeNode>
> </rich:tree>
> </h:form>
> The strange thing is that the backend code is called and fills in the
> intended contex menu component successfully and even the AJAX response is
> returned to the browser with what seems to be a correct javascript
> representation of the context menu. But the context menu is then not shown.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
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