[
https://issues.jboss.org/browse/RF-11973?page=com.atlassian.jira.plugin.s...
]
Pjotr Andreev commented on RF-11973:
------------------------------------
Hi, You welcome! The workaround is (the context menu`s items #cmi1 and #cmi2 will be
re-rendered on row selection change,
then, after #cmi2 action, the table and contextMenu will be re-rendered):
<rich:extendedDataTable id="table" selection=#{listener.selection}>
<a4j:ajax execute="@form" event="selectionchange"
listener="#{listener.selectionChanged}" render=":cmi1 :cmi2"
limitRender="true"/>
<rich:column>Column Content</rich:column>
</rich:extendedDataTable>
<rich:contextMenu id="contextMenu" mode="ajax"
target="table" showEvent="click">
<rich:menuItem id="cmi0" label="I am invisible"
mode="client" style="display: none;"/>
<rich:menuItem id="cmi1" label="I am visible"
mode="client"/>
<rich:menuItem id="cmi2" label="I am visible too"
mode="ajax" render="table contextMenu"
limitRender="true"/>
</rich:contextMenu>
The sequence of execution is:
1. click event sent to the table
2. contextMenu is shown, since it reacts on click event
3. the onchange event is processed and AJAX request sent to the server
4. the partial update response with new #cmi1 and #cmi2 item contents is processed on the
client and
5. the DOM of #cmi1 and #cmi2 is replaced in the contextMenu popup already shown
And by the way every time the table is rendered, the contextMenu MUST be re-rendered as
well, otherwise the "showEvent" becomes unregistered...
rich:contextMenu - after ajax re-render of table contextMenu no
longer works
----------------------------------------------------------------------------
Key: RF-11973
URL:
https://issues.jboss.org/browse/RF-11973
Project: RichFaces
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: 4.2.0.CR1
Environment: chrome browser / glassfish 3.1.1 / mojarra 2.1.6
Reporter: Brendan Healey
Fix For: 4.3-Tracking
With the following code structure, when the page is first rendered
you can right click on a row in the table and the context menu appears.
After pushing the commandButton subsequent right clicks show the
default browser right click menu, and not the context menu.
{code}
<rich:extendedDataTable id="mytable">
...
</rich:extendedDataTable>
<a4j:commandButton value="push" render="mytable"/>
<rich:contextMenu target="mytable" mode="ajax">
<rich:menuItem label="Delete"
mode="ajax"
onclick="alert('hello, world!')"/>
</rich:contextMenu>
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira