protected Context getPageContext() { return Contexts.getPageContext(); }
public void resetParameters() { setupConfigGenerator = null; parameters = null; advancedParameters = null; Contexts.getPageContext().remove("setupConfigGenerator"); }
public void setSearchFilter(String searchFilter) { Context pageContext = Contexts.getPageContext(); if (pageContext != null) { pageContext.set("searchFilter", searchFilter); } this.searchFilter = searchFilter; }
@Factory(value="org.jboss.seam.core.pageContext", autoCreate=true) public Context getPageContext() { return org.jboss.seam.contexts.Contexts.getPageContext(); }
public void resetParameters() { setupConfigGenerator = null; parameters = null; advancedParameters = null; Contexts.getPageContext().remove("setupConfigGenerator"); }
/** * Call the JSF navigation handler */ public static void handleOutcome(FacesContext facesContext, String outcome, String fromAction) { facesContext.getApplication().getNavigationHandler() .handleNavigation(facesContext, fromAction, outcome); //after every time that the view may have changed, //we need to flush the page context, since the //attribute map is being discarder Contexts.getPageContext().flush(); }
@OperationMethod public DocumentModel push(DocumentModel value) { if ("session".equalsIgnoreCase(scope)) { Contexts.getSessionContext().set(name, value); } else if ("conversation".equalsIgnoreCase(scope)) { Contexts.getConversationContext().set(name, value); } else if ("page".equalsIgnoreCase(scope)) { Contexts.getPageContext().set(name, value); } else if ("event".equalsIgnoreCase(scope)) { Contexts.getEventContext().set(name, value); } return value; }
/** * Get the page parameter values that were passed in the original request from * the PAGE context */ public Map<String, Object> getStringValuesFromPageContext(FacesContext facesContext) { Map<String, Object> parameters = new HashMap<String, Object>(); String viewId = getViewId(facesContext); for ( Page page: getPageStack(viewId) ) { for ( Param pageParameter: page.getParameters() ) { Object object = Contexts.getPageContext().get( pageParameter.getName() ); if (object!=null) { parameters.put( pageParameter.getName(), object ); } } } return parameters; }
if ( isRequired() && !Contexts.getPageContext().isSet( getName() ) )
return Contexts.getPageContext(); case CONVERSATION: if ( !Contexts.isConversationContextActive() )
/** * Update the page parameter values stored in the PAGE context with the current * values of the mapped attributes of the model */ public void updateStringValuesInPageContextUsingModel(FacesContext facesContext) { for ( Page page: getPageStack( getViewId(facesContext) ) ) { for ( Param pageParameter: page.getParameters() ) { if ( pageParameter.getValueExpression()!=null ) { String value = pageParameter.getStringValueFromModel(facesContext); if (value==null) { Contexts.getPageContext().remove( pageParameter.getName() ); } else { Contexts.getPageContext().set( pageParameter.getName(), value ); } } } } }
/** * Restore the page and conversation contexts during a JSF request */ protected void afterRestoreView(FacesContext facesContext) { boolean conversationFound = Contexts.isPageContextActive() ? Contexts.getPageContext().isSet("org.jboss.seam.jsf.SeamPhaseListener.conversationFound") : false; FacesLifecycle.resumePage(); Map parameters = facesContext.getExternalContext().getRequestParameterMap(); if (!conversationFound) // there is exceptional case when restoring of conversation wasn't called while page context was lazily initialized { ConversationPropagation.instance().restoreConversationId(parameters); conversationFound = Manager.instance().restoreConversation(); } FacesLifecycle.resumeConversation( facesContext.getExternalContext() ); postRestorePage(facesContext, parameters, conversationFound); }
value = (String) Contexts.getPageContext().get(pageParameter.getName());
private void storeRequestStringValuesInPageContext(FacesContext facesContext) { Parameters parameters = Parameters.instance(); if (parameters!=null) //for unit tests { Map<String, String[]> requestParameters = parameters.getRequestParameters(); for ( Page page: getPageStack( getViewId(facesContext) ) ) { for ( Param pageParameter: page.getParameters() ) { String value = pageParameter.getStringValueFromRequest(facesContext, requestParameters); if (value==null) { //this should not be necessary, were it not for a MyFaces bug if ( facesContext.getRenderResponse() ) //ie. for a non-faces request { Contexts.getPageContext().remove( pageParameter.getName() ); } } else { Contexts.getPageContext().set( pageParameter.getName(), value ); } } } } }
Context pageContext = Contexts.getPageContext();
String value = (String) Contexts.getPageContext().get( pageParameter.getName() ); if (value!=null)
getPageContext().remove(name);
Object result = getPageContext().get(name); if (result!=null)