org.primefaces.context
Class DefaultRequestContext

java.lang.Object
  extended by org.primefaces.context.RequestContext
      extended by org.primefaces.context.DefaultRequestContext

public class DefaultRequestContext
extends RequestContext


Constructor Summary
DefaultRequestContext(javax.faces.context.FacesContext context)
           
 
Method Summary
 void addCallbackParam(String name, Object value)
          Add a parameter for ajax oncomplete client side callbacks.
 void closeDialog(Object data)
          Close a dialog.
 void execute(String script)
          Execute a javascript after current ajax request is completed.
 AjaxRequestBuilder getAjaxRequestBuilder()
           
 ApplicationContext getApplicationContext()
           
 Map<Object,Object> getAttributes()
           
 Map<String,Object> getCallbackParams()
           
 CSVBuilder getCSVBuilder()
           
 StringEncrypter getEncrypter()
           
 List<String> getScriptsToExecute()
           
 WidgetBuilder getWidgetBuilder()
           
 boolean isAjaxRequest()
           
 boolean isIgnoreAutoUpdate()
           
 boolean isSecure()
          Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS.
 void openDialog(String outcome)
          Open a view in dialog.
 void openDialog(String outcome, Map<String,Object> options, Map<String,List<String>> params)
          Open a view in dialog.
 void release()
          Clear resources.
 void reset(Collection<String> expressions)
          Reset a collection of editableValueHolders.
 void reset(String expressions)
          Reset an editableValueHolder.
 void scrollTo(String clientId)
          Scroll to a component after ajax request is completed.
 void showMessageInDialog(javax.faces.application.FacesMessage message)
          Displays a message in a dialog.
 void update(Collection<String> collection)
          Update components with ajax.
 void update(String clientId)
          Update a component with ajax.
 
Methods inherited from class org.primefaces.context.RequestContext
getCurrentInstance, setCurrentInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultRequestContext

public DefaultRequestContext(javax.faces.context.FacesContext context)
Method Detail

isAjaxRequest

public boolean isAjaxRequest()
Specified by:
isAjaxRequest in class RequestContext
Returns:
true if request is an ajax request, otherwise return false.

addCallbackParam

public void addCallbackParam(String name,
                             Object value)
Description copied from class: RequestContext
Add a parameter for ajax oncomplete client side callbacks. Value would be serialized to json.

Specified by:
addCallbackParam in class RequestContext
Parameters:
name - name of the parameter.

execute

public void execute(String script)
Description copied from class: RequestContext
Execute a javascript after current ajax request is completed.

Specified by:
execute in class RequestContext
Parameters:
script - Javascript statement to execute.

getCallbackParams

public Map<String,Object> getCallbackParams()
Specified by:
getCallbackParams in class RequestContext
Returns:
all callback parameters added in the current request.

getScriptsToExecute

public List<String> getScriptsToExecute()
Specified by:
getScriptsToExecute in class RequestContext
Returns:
all scripts added in the current request.

getWidgetBuilder

public WidgetBuilder getWidgetBuilder()
Specified by:
getWidgetBuilder in class RequestContext
Returns:
Shared WidgetBuilder instance of the current request

getAjaxRequestBuilder

public AjaxRequestBuilder getAjaxRequestBuilder()
Specified by:
getAjaxRequestBuilder in class RequestContext
Returns:
Shared AjaxRequestBuilder instance of the current request

getCSVBuilder

public CSVBuilder getCSVBuilder()
Specified by:
getCSVBuilder in class RequestContext
Returns:
Shared Client Side Validation builder instance of the current request

scrollTo

public void scrollTo(String clientId)
Description copied from class: RequestContext
Scroll to a component after ajax request is completed.

Specified by:
scrollTo in class RequestContext
Parameters:
clientId - Client side identifier of the component.

update

public void update(String clientId)
Description copied from class: RequestContext
Update a component with ajax.

Specified by:
update in class RequestContext
Parameters:
clientId - Client side identifier of the component.

update

public void update(Collection<String> collection)
Description copied from class: RequestContext
Update components with ajax.

Specified by:
update in class RequestContext
Parameters:
collection - Client side identifiers of the components.

reset

public void reset(Collection<String> expressions)
Description copied from class: RequestContext
Reset a collection of editableValueHolders.

Specified by:
reset in class RequestContext
Parameters:
expressions - A list with with one or multiple search expression to resolve the components.

reset

public void reset(String expressions)
Description copied from class: RequestContext
Reset an editableValueHolder.

Specified by:
reset in class RequestContext
Parameters:
expressions - A string with one or multiple search expression to resolve the components.

openDialog

public void openDialog(String outcome)
Description copied from class: RequestContext
Open a view in dialog.

Specified by:
openDialog in class RequestContext
Parameters:
outcome - The logical outcome used to resolve a navigation case.

openDialog

public void openDialog(String outcome,
                       Map<String,Object> options,
                       Map<String,List<String>> params)
Description copied from class: RequestContext
Open a view in dialog.

Specified by:
openDialog in class RequestContext
Parameters:
outcome - The logical outcome used to resolve a navigation case.
options - Configuration options for the dialog.
params - Parameters to send to the view displayed in a dialog.

closeDialog

public void closeDialog(Object data)
Description copied from class: RequestContext
Close a dialog.

Specified by:
closeDialog in class RequestContext
Parameters:
data - Optional data to pass back to a dialogReturn event.

showMessageInDialog

public void showMessageInDialog(javax.faces.application.FacesMessage message)
Description copied from class: RequestContext
Displays a message in a dialog.

Specified by:
showMessageInDialog in class RequestContext
Parameters:
message - FacesMessage to be displayed.

release

public void release()
Description copied from class: RequestContext
Clear resources.

Specified by:
release in class RequestContext

getAttributes

public Map<Object,Object> getAttributes()
Specified by:
getAttributes in class RequestContext
Returns:
Attributes map in RequestContext scope

getApplicationContext

public ApplicationContext getApplicationContext()
Specified by:
getApplicationContext in class RequestContext
Returns:
ApplicationContext instance.

getEncrypter

public StringEncrypter getEncrypter()
Specified by:
getEncrypter in class RequestContext
Returns:
StringEncrypter used to encode and decode a string.

isSecure

public boolean isSecure()
Description copied from class: RequestContext
Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS.

Specified by:
isSecure in class RequestContext

isIgnoreAutoUpdate

public boolean isIgnoreAutoUpdate()
Specified by:
isIgnoreAutoUpdate in class RequestContext
Returns:
true if AutoUpdatable components should not be updated automatically in this request.


Copyright © 2013. All rights reserved.