public static boolean isDisabledOrReadonly(UIInput component) {
        return Boolean.parseBoolean(String.valueOf(component.getAttributes().get("disabled")))
                || Boolean.parseBoolean(String.valueOf(component.getAttributes().get("readonly")));
    }
Execute a callback in a stateless scope by temporarily removing and restoring a variable from the FacesContext attributes.

@param context The FacesContext used for accessing attributes
@param var The variable to be temporarily removed and restored in the context attributes
@param runnable The callback to be executed
@param <E> The type of Throwable that may be thrown
@throws E If the callback throws an exception of type E
primefaces/src/main/java/org/primefaces/util/ComponentUtils.java