Package org.omnifaces.renderer
Class DeferredScriptRenderer
- java.lang.Object
-
- jakarta.faces.render.Renderer
-
- org.omnifaces.renderer.DeferredScriptRenderer
-
public class DeferredScriptRenderer extends Renderer
This renderer is the default renderer ofDeferredScript
. The rendering is extracted from the component so that it can be reused byCombinedResourceHandler
.- Since:
- 1.8
- Author:
- Bauke Scholtz
-
-
Field Summary
Fields Modifier and Type Field Description static String
RENDERER_TYPE
The standard renderer type.-
Fields inherited from class jakarta.faces.render.Renderer
PASSTHROUGH_RENDERER_LOCALNAME_KEY
-
-
Constructor Summary
Constructors Constructor Description DeferredScriptRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
encodeBegin(FacesContext context, UIComponent component)
Writes a<script>
element which callsOmniFaces.DeferredScript.add
with as arguments the script URL and, if any, the onbegin, onsuccess and/or onerror callbacks.void
encodeEnd(FacesContext context, UIComponent component)
-
Methods inherited from class jakarta.faces.render.Renderer
convertClientId, decode, encodeChildren, getConvertedValue, getRendersChildren
-
-
-
-
Field Detail
-
RENDERER_TYPE
public static final String RENDERER_TYPE
The standard renderer type.- See Also:
- Constant Field Values
-
-
Method Detail
-
encodeBegin
public void encodeBegin(FacesContext context, UIComponent component) throws IOException
Writes a<script>
element which callsOmniFaces.DeferredScript.add
with as arguments the script URL and, if any, the onbegin, onsuccess and/or onerror callbacks. If the script resource is not resolvable, then aRES_NOT_FOUND
will be written tosrc
attribute instead.- Overrides:
encodeBegin
in classRenderer
- Throws:
IOException
-
encodeEnd
public void encodeEnd(FacesContext context, UIComponent component) throws IOException
- Overrides:
encodeEnd
in classRenderer
- Throws:
IOException
-
-