This appears to be an elegant solution to disable and enable PrimeFaces CommandButton
and available in version 8 and up of PrimeFaces.
Unfortunately, I'm unable to compile it in PrimeFaces 6.1, Java 8.
It now compiles with the suggested update, Thanks, but the method doesn't return the correct type - String.
It could be related to the structure of our DOM, we have multiple layers of xhtml, the first loaded index.xhtml doesn't have any buttons. But the CommandButtonSingleClickRenderer.java is being called. The properties of the CommandButton are all default values.
protected String getAttributeValue(final FacesContext context, final CommandButton button, final String attribute)
returns null
Added a check for null prior to the call to getToggleJS to get the pages with buttons loaded.
What is required in the commandButton ? How do you call the CommandButtonSingleClickRenderer from xhtml ?