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 classPrimeFaces.AjaxclassPrimeFaces.DialogclassPrimeFaces.MultiViewState
-
Constructor Summary
Constructors Modifier Constructor Description protectedPrimeFaces()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.Ajaxajax()static PrimeFacescurrent()PrimeFaces.Dialogdialog()Returns the dialog helpers.voidexecuteInitScript(String statement)Executes a JavaScript statement before all other PrimeFaces scripts are executed.voidexecuteScript(String statement)Executes a JavaScript statement.voidfocus(String expression)Resolves the search expression, starting from the viewroot, and focus the resolved component.voidfocus(String expression, javax.faces.component.UIComponent base)Resolves the search expression and focus the resolved component.protected javax.faces.context.FacesContextgetFacesContext()protected PrimeRequestContextgetRequestContext()booleanisAjaxRequest()Shortcut forPartialViewContext.isAjaxRequest().booleanisFacesRequest()Checks if the current request is a Faces request.PrimeFaces.MultiViewStatemultiViewState()Returns the MultiViewState helpers.voidresetInputs(String... expressions)Resolves the search expressions, starting from the viewroot and resets all foundUIInputcomponents.voidresetInputs(Collection<String> expressions)Resolves the search expressions, starting from the viewroot and resets all foundUIInputcomponents.voidscrollTo(String clientId)Scrolls to a component with the given clientId.static voidsetCurrent(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:
trueif the current request is a Faces request.
-
isAjaxRequest
public boolean isAjaxRequest()
Shortcut forPartialViewContext.isAjaxRequest().- Returns:
trueif 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 foundUIInputcomponents.- Parameters:
expressions- a list of search expressions.
-
resetInputs
public void resetInputs(String... expressions)
Resolves the search expressions, starting from the viewroot and resets all foundUIInputcomponents.- 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.
-
-