Package org.primefaces
Class PrimeFaces
- java.lang.Object
-
- org.primefaces.PrimeFaces
-
public class PrimeFaces extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
PrimeFaces.Ajax
class
PrimeFaces.Dialog
class
PrimeFaces.MultiViewState
-
Constructor Summary
Constructors Modifier Constructor Description protected
PrimeFaces()
Protected constructor to allow CDI proxying - and also allow customizations, or setting a mock.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PrimeFaces.Ajax
ajax()
static PrimeFaces
current()
PrimeFaces.Dialog
dialog()
Returns the dialog helpers.void
executeInitScript(String statement)
Executes a JavaScript statement before all other PrimeFaces scripts are executed.void
executeScript(String statement)
Executes a JavaScript statement.void
focus(String expression)
Resolves the search expression, starting from the viewroot, and focus the resolved component.void
focus(String expression, javax.faces.component.UIComponent base)
Resolves the search expression and focus the resolved component.protected javax.faces.context.FacesContext
getFacesContext()
protected PrimeRequestContext
getRequestContext()
boolean
isAjaxRequest()
Shortcut forPartialViewContext.isAjaxRequest()
.boolean
isFacesRequest()
Checks if the current request is a Faces request.PrimeFaces.MultiViewState
multiViewState()
Returns the MultiViewState helpers.void
resetInputs(String... expressions)
Resolves the search expressions, starting from the viewroot and resets all foundUIInput
components.void
resetInputs(Collection<String> expressions)
Resolves the search expressions, starting from the viewroot and resets all foundUIInput
components.void
scrollTo(String clientId)
Scrolls to a component with the given clientId.static void
setCurrent(PrimeFaces primeFaces)
-
-
-
Method Detail
-
current
public static PrimeFaces current()
-
setCurrent
public static void setCurrent(PrimeFaces primeFaces)
-
getFacesContext
protected javax.faces.context.FacesContext getFacesContext()
-
getRequestContext
protected PrimeRequestContext getRequestContext()
-
isFacesRequest
public boolean isFacesRequest()
Checks if the current request is a Faces request.- Returns:
true
if the current request is a Faces request.
-
isAjaxRequest
public boolean isAjaxRequest()
Shortcut forPartialViewContext.isAjaxRequest()
.- Returns:
true
if the current request is a AJAX request.
-
executeInitScript
public void executeInitScript(String statement)
Executes a JavaScript statement before all other PrimeFaces scripts are executed. Useful when you need to do some initialization.- Parameters:
statement
- the JavaScript statement.
-
executeScript
public void executeScript(String statement)
Executes a JavaScript statement.- Parameters:
statement
- the JavaScript statement.
-
scrollTo
public void scrollTo(String clientId)
Scrolls to a component with the given clientId.- Parameters:
clientId
- clientId of the target component.
-
focus
public void focus(String expression)
Resolves the search expression, starting from the viewroot, and focus the resolved component.- Parameters:
expression
- The search expression.
-
focus
public void focus(String expression, javax.faces.component.UIComponent base)
Resolves the search expression and focus the resolved component.- Parameters:
expression
- the search expression.base
- the base component from which we will start to resolve the search expression.
-
resetInputs
public void resetInputs(Collection<String> expressions)
Resolves the search expressions, starting from the viewroot and resets all foundUIInput
components.- Parameters:
expressions
- a list of search expressions.
-
resetInputs
public void resetInputs(String... expressions)
Resolves the search expressions, starting from the viewroot and resets all foundUIInput
components.- Parameters:
expressions
- a list of search expressions.
-
dialog
public PrimeFaces.Dialog dialog()
Returns the dialog helpers.- Returns:
- the dialog helpers.
-
ajax
public PrimeFaces.Ajax ajax()
-
multiViewState
public PrimeFaces.MultiViewState multiViewState()
Returns the MultiViewState helpers.- Returns:
- the MultiViewState helpers.
-
-