Package org.primefaces.util
Class WidgetBuilder
java.lang.Object
org.primefaces.util.WidgetBuilder
Helper to generate scripts for widgets.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected PrimeConfigurationprotected javax.faces.context.FacesContextprotected boolean -
Constructor Summary
ConstructorsConstructorDescriptionWidgetBuilder(javax.faces.context.FacesContext context, PrimeConfiguration configuration) -
Method Summary
Modifier and TypeMethodDescriptionappend(char chr) voidfinish()Deprecated.protected WidgetBuilder<T extends javax.faces.component.UIComponent & Widget>
WidgetBuilderinitWithComponentLoad(String widgetClass, String widgetVar, String id, String targetId) <T extends javax.faces.component.UIComponent & Widget>
WidgetBuilderinitWithComponentLoad(String widgetClass, T widget, String targetId) initWithWindowLoad(String widgetClass, String widgetVar, String id) <T extends javax.faces.component.UIComponent & Widget>
WidgetBuilderinitWithWindowLoad(String widgetClass, T widget) nativeAttr(String name, String value) nativeAttr(String name, String value, String defaultValue) protected WidgetBuilderrenderLifecycleCallbacks(javax.faces.component.UIComponent component) protected voidreturnCallback(String name, String signature, String callback) selectorAttr(String name, String value) This should only be used internally if the selector is directly used by jQuery on the client.
-
Field Details
-
endFunction
protected boolean endFunction -
context
protected javax.faces.context.FacesContext context -
configuration
-
-
Constructor Details
-
WidgetBuilder
-
-
Method Details
-
init
protected WidgetBuilder init(String widgetClass, String widgetVar, String id, boolean endFunction) throws IOException - Parameters:
widgetClass- Constructor name of the widgetwidgetVar- Name of the client side widgetid- Client id of the componentendFunction- If the init script is wrapped by a method and if the endFunction parentheses should be rendered.- Returns:
- The current instance.
- Throws:
IOException- if any IO exception occurs
-
init
public <T extends javax.faces.component.UIComponent & Widget> WidgetBuilder init(String widgetClass, T widget) throws IOException - Throws:
IOException
-
init
@Deprecated public WidgetBuilder init(String widgetClass, String widgetVar, String id) throws IOException Deprecated.Useinit(String, UIComponent)instead- Throws:
IOException
-
initWithWindowLoad
public <T extends javax.faces.component.UIComponent & Widget> WidgetBuilder initWithWindowLoad(String widgetClass, T widget) throws IOException - Throws:
IOException
-
initWithWindowLoad
public WidgetBuilder initWithWindowLoad(String widgetClass, String widgetVar, String id) throws IOException - Throws:
IOException
-
initWithComponentLoad
public <T extends javax.faces.component.UIComponent & Widget> WidgetBuilder initWithComponentLoad(String widgetClass, T widget, String targetId) throws IOException - Throws:
IOException
-
initWithComponentLoad
public WidgetBuilder initWithComponentLoad(String widgetClass, String widgetVar, String id, String targetId) throws IOException - Throws:
IOException
-
renderScriptBlock
- Throws:
IOException
-
renderLifecycleCallbacks
protected WidgetBuilder renderLifecycleCallbacks(javax.faces.component.UIComponent component) throws IOException - Throws:
IOException
-
selectorAttr
This should only be used internally if the selector is directly used by jQuery on the client. If PFS is used and specified by the user,attr(java.lang.String, java.lang.String)should be used as the users have to escape colons like @(myForm\:myId).- Parameters:
name- of the attributevalue- of the selector- Returns:
- the WidgetBuilder
- Throws:
IOException- if any error occurs
-
attr
- Throws:
IOException
-
nativeAttr
- Throws:
IOException
-
nativeAttr
- Throws:
IOException
-
attr
- Throws:
IOException
-
attr
- Throws:
IOException
-
attr
- Throws:
IOException
-
attr
- Throws:
IOException
-
attr
- Throws:
IOException
-
attr
- Throws:
IOException
-
callback
- Throws:
IOException
-
returnCallback
public WidgetBuilder returnCallback(String name, String signature, String callback) throws IOException - Throws:
IOException
-
callback
- Throws:
IOException
-
append
- Throws:
IOException
-
append
- Throws:
IOException
-
append
- Throws:
IOException
-
finish
- Throws:
IOException
-
init(String, UIComponent)instead