New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ContextMenu: cannot be conditionally toggled with ajax #9863
Comments
If |
|
I think I know the issue. Let me try something. |
Reproducer: OK so the issue is because when its created its registering So I have added a |
@NicolaIsotta working workaround for you! if (PrimeFaces.widget.ContextMenu) {
PrimeFaces.widget.ContextMenu.prototype._cleanup = function() {
if (this.cfg.target === undefined) {
var event = 'contextmenu.' + this.id + '_contextmenu';
$(document).off(event);
if (PrimeFaces.env.isTouchable(this.cfg)) {
$(document).swipe().destroy();
}
}
else {
var event = this.cfg.event + '.' + this.id + '_contextmenu';
$(document).off(event, this.jqTargetId);
if (PrimeFaces.env.isTouchable(this.cfg)) {
this.jqTarget.swipe().destroy();
}
}
}
} <p:commandButton
value="Toggle context menu"
action="#{testView.toggleContextMenu()}"
update="@form"
onstart="PF('cm')._cleanup();" /> |
Because this is a special case and it can't tell the widget is being updated in 13.0.0 you will just have to call |
Describe the bug
If a context menu renderd value evaluates to false, it shouldn't be displayed even if it was displayed before.
Reproducer
To reproduce: open the page, press the button and right click the text: the context menu appears even if it shouldn't.
Expected behavior
if rendered evaluates to false, context menu shouldn't be displayed
PrimeFaces edition
Community
PrimeFaces version
12.0.0
Theme
No response
JSF implementation
Mojarra
JSF version
2.3.19
Java version
jdk-11.0.13
Browser(s)
No response
The text was updated successfully, but these errors were encountered: