Class PrimeFaces


  • public class PrimeFaces
    extends Object
    • Constructor Detail

      • PrimeFaces

        protected PrimeFaces()
        Protected constructor to allow CDI proxying - and also allow customizations, or setting a mock.
    • Method Detail

      • setCurrent

        public static void setCurrent​(PrimeFaces primeFaces)
      • getFacesContext

        protected javax.faces.context.FacesContext getFacesContext()
      • 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 for PartialViewContext.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 found UIInput 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 found UIInput components.
        Parameters:
        expressions - a list of search expressions.
      • dialog

        public PrimeFaces.Dialog dialog()
        Returns the dialog helpers.
        Returns:
        the dialog helpers.
      • multiViewState

        public PrimeFaces.MultiViewState multiViewState()
        Returns the MultiViewState helpers.
        Returns:
        the MultiViewState helpers.