public class BaseViewBean extends BaseFacesSessionBean implements PhaseListener
Modifier and Type | Class and Description |
---|---|
protected class |
BaseViewBean.ClientIdsContentProvider
Providers that maps raw control ids to client-side element ids.
|
Modifier and Type | Field and Description |
---|---|
protected IContentProvider |
clientIds
IContentProvider to map raw control ids to client-side element ids. |
protected boolean |
initialized
boolean to check if the Bean is initialized. |
fExpireWithPageFlow
DATA_BINDING_CLIENTS, OUTCOME_ERROR, OUTCOME_OK, resourcesProviders
Constructor and Description |
---|
BaseViewBean()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
protected void |
afterApplyRequestValues()
Clients should overwrite this method to perform custom actions after
request parameters are applied to the controls.
|
protected void |
afterInvokeApplication()
Clients should overwrite this method to perform custom actions after an
action method is invoked.
|
void |
afterPhase(PhaseEvent event)
Implementation method of the JSF phase listener.
|
protected void |
afterProcessValidations()
Clients should overwrite this method to perform custom actions after
validation is performed.
|
protected void |
afterRenderResponse()
Clients should overwrite this method to perform custom actions after the
view got rendered.
|
protected void |
afterRestoreView()
Clients should overwrite this method to perform custom actions after the
view got restored from the postback render request.
|
protected void |
afterUpdateModelValues()
Clients should overwrite this method to perform custom actions after
controls updated data model using submitted values.
|
protected void |
beforeApplyRequestValues()
Clients should overwrite this method to perform custom actions before
request parameters are applied to the controls.
|
protected void |
beforeInvokeApplication()
Clients should overwrite this method to perform custom actions before an
action method is invoked.
|
void |
beforePhase(PhaseEvent event)
Implementation method of the JSF phase listener.
|
protected void |
beforeProcessValidations()
Clients should overwrite this method to perform custom actions before
validation is performed.
|
protected void |
beforeRenderResponse()
Clients should overwrite this method to perform custom actions before the
view gets rendered.
|
protected void |
beforeRestoreView()
Clients should overwrite this method to perform custom actions before the
view gets restored from the postback render request.
|
protected void |
beforeUpdateModelValues()
Clients should overwrite this method to perform custom actions before
controls update data model using submitted values.
|
protected void |
callInitialize()
Initializes the bean if not already done.
|
UIComponent |
findComponent(UIComponent base,
String id)
Return the
UIComponent (if any) with the specified
id , searching recursively starting at the specified
base , and examining the base component itself, followed by
examining all the base component's facets and children. |
UIComponent |
findComponentInRoot(String id)
Finds components by its
id in the root of the component
tree. |
protected Map |
getApplicationScope()
Returns writable map of application scoped attributes
|
IContentProvider |
getClientIds()
Maps raw control ids to client-side element ids.
|
PhaseId |
getPhaseId()
Returns
PhaseId.ANY_PHASE which indicates all standard phases. |
protected static String |
getRealPath(String relPath)
Returns a full system path for a resource path given relative to the web
application root.
|
protected Map |
getRequestParam()
Returns read-only map of request parameters
|
protected Map |
getRequestScope()
Returns writable map of request scoped attributes
|
protected Map |
getSessionScope()
Returns writable map of session scoped attributes.
|
void |
gotoPage(String pageURI)
Deprecated.
use
BaseViewBean.gotoPage(String, boolean) instead. |
void |
gotoPage(String pageURI,
boolean redirect)
Switches to the specified view page.
|
protected String |
initialize()
This gets overwritten in the page bean classes to be a public dataflow
method implementation
|
boolean |
isAsyncRequest()
Returns
true if current request is an async request. |
void |
preRenderResponse(PreRenderViewEvent e)
The JSF 2.x technique for doing logic before rendering a view.
|
protected void |
release()
Override this method to release any resources associated with this session.
|
protected void |
resetPageFlowStorage()
Reset the storage used for Page Flow.
|
protected void |
streamFileDataToResponse(IFileExportBean exportBean)
Helper method that can be called to stream an exported file back to
the response.
|
getExpireWithPageFlow, setExpireWithPageFlow, valueBound, valueUnbound
createMethodBinding, createValueBinding, error, error, error, error, error, getBean, getFacesContext, getLocale, getResourceInputStream, getResources, getResourcesProvider, getRootCause, getStackTrace, getTreeAttribute, isUserInRole, log, log, log, putTreeAttribute, resetDataBindingClients, resolveDataBinding, resolveDataBinding, resolveExpression, setValue
protected transient IContentProvider clientIds
IContentProvider
to map raw control ids to client-side element ids.protected transient boolean initialized
boolean
to check if the Bean
is initialized.protected void release()
BaseFacesSessionBean
release
in class BaseFacesSessionBean
protected void streamFileDataToResponse(IFileExportBean exportBean)
exportBean
- the bean describing the file to exportpublic void beforePhase(PhaseEvent event)
beforePhase
in interface PhaseListener
event
- JSF phase evenpublic void preRenderResponse(PreRenderViewEvent e)
e
- the system eventprotected void callInitialize()
protected String initialize()
null
by default, subclasses may return
other status codes as needed.public void afterPhase(PhaseEvent event)
afterPhase
in interface PhaseListener
event
- JSF PhaseEvent
public PhaseId getPhaseId()
PhaseId.ANY_PHASE
which indicates all standard phases.getPhaseId
in interface PhaseListener
PhaseListener.getPhaseId()
public void gotoPage(String pageURI)
BaseViewBean.gotoPage(String, boolean)
instead.pageURI
- the uri of the page, for example: /portlet1/mypage.viewpublic void gotoPage(String pageURI, boolean redirect)
pageURI
- the uri of the page, for example: /portlet1/mypage.viewredirect
- true to redirect to the page, false to just change the
FacesContext view rootpublic UIComponent findComponent(UIComponent base, String id)
Return the UIComponent
(if any) with the specified
id
, searching recursively starting at the specified
base
, and examining the base component itself, followed by
examining all the base component's facets and children. Unlike
findComponent method of UIComponentBase
, which skips recursive
scan each time it finds a NamingContainer
, this method examines
all components, regardless of their namespace (assuming IDs are unique).
base
- Base UIComponent
from which to searchid
- Component identifier to be matchedpublic UIComponent findComponentInRoot(String id)
id
in the root of the component
tree.id
- the component idUIComponent
or null if not foundpublic IContentProvider getClientIds()
Maps raw control ids to client-side element ids.
For example, #{myPageBean.clientIds.myControlId} returns the client-side id (ie "wmp1234:zID3:myControlId") for the control with an id of 'myControlId'.
IContentProvider
for ID mapping.public boolean isAsyncRequest()
true
if current request is an async request.true
for async requestprotected static String getRealPath(String relPath)
relPath
- relative path of the web resourceString
for full system path of this resource, or null if it cannot be
calculatedprotected Map getApplicationScope()
Map <String, Object>
of attributesprotected Map getRequestParam()
Map <String, Object>
of parametersprotected Map getRequestScope()
Map <String, Object>
of attributesprotected Map getSessionScope()
Map <String, Object>
of attributesprotected void beforeRestoreView()
protected void afterRestoreView()
protected void beforeApplyRequestValues()
protected void afterApplyRequestValues()
protected void beforeProcessValidations()
protected void afterProcessValidations()
protected void beforeUpdateModelValues()
protected void afterUpdateModelValues()
protected void beforeInvokeApplication()
protected void afterInvokeApplication()
protected void beforeRenderResponse()
protected void afterRenderResponse()
protected void resetPageFlowStorage()