vineri, 24 aprilie 2015

[OmniFaces utilities (2.0)] Check whether the given script resource is rendered


[OmniFaces utilities] The isScriptResourceRendered() method returns whether the given script resource is rendered.

Method:

Usage:

See also: Set the given script/stylesheet resource asrendered

FacesContext context = ...;
boolean isScriptRendered = Hacks.isScriptResourceRendered(context, new ResourceIdentifier(script_component))
if(isScriptRendered){
   // is
} else {
   //is not
}

Note The OmniFaces org.omnifaces.resourcehandler.ResourceIdentifier is a convenience class to represent a resource identifier (maps resource name and library).

Niciun comentariu:

Trimiteți un comentariu