Yes, sure, I'm aware of this ticket. I meant another issue - not upcoming "disabled" attribute, but JS manipulation. According to the YUI docu the following construct
Code: Select all
menubarWidget.getItem(index).cfg.setProperty("disabled", true);
should prevent onclick event. But it doesn't that. I can click on disabled (dimmed) menuitem and an Ajax request will be sent. The same situation with p:commandLink. I couldn't prevent onclick event per JavaScript and activate it again.
You can try to use jQuery unbind('click') / bind('click', function() {...}) or attr('onclick') and manipulate inline onclick with "return false;" or "event.preventDefault();". Nothing helps, because PrimeFaces writes Ajax call in onclick attribute and the default behavior stays href="javascript:void(0)". It would help if the Ajax call stood in href. Disabling for pure YUI menuitems works as specified because URL resides in href. I spent a whole day and found a workaround - a tricky solution how I can prevent ajax calls with JavaScript and activate them again (original onlick listener). Namely for both cases - PrimeFaces menuitem and command link.