本文整理匯總了Java中javax.faces.component.UIViewRoot.getViewId方法的典型用法代碼示例。如果您正苦於以下問題:Java UIViewRoot.getViewId方法的具體用法?Java UIViewRoot.getViewId怎麽用?Java UIViewRoot.getViewId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.faces.component.UIViewRoot
的用法示例。
在下文中一共展示了UIViewRoot.getViewId方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getRedirectURL
import javax.faces.component.UIViewRoot; //導入方法依賴的package包/類
/**
* Create an URL that will point to the frame redirect page.
* @param context the FacesContext
* @param viewRoot the UIViewRoot that will subsequently displayed.
* The viewRoot itself is not saved, but values like the locale
* and viewId are saved.
* @param minWidth the minimum width for the target page.
* @param minHeight the minimum height for the target page.
*/
static public String getRedirectURL(FacesContext context,
UIViewRoot viewRoot,
String minWidth,
String minHeight)
{
String baseURL = GenericEntry.getGenericEntryURL(
context,
GenericEntry.NEW_FRAME_REDIRECT_ENTRY);
String[] args = new String[]
{
_VIEW_ID_REDIRECT_PARAM,
viewRoot.getViewId(),
"loc",
viewRoot.getLocale().toString().replace('_', '-'),
_MIN_WIDTH_PARAM,
minWidth,
_MIN_HEIGHT_PARAM,
minHeight
};
return EncoderUtils.appendURLArguments(baseURL, args);
}
示例2: beforePhase
import javax.faces.component.UIViewRoot; //導入方法依賴的package包/類
@Override
public void beforePhase(PhaseEvent arg0) {
FacesContext facesContext = arg0.getFacesContext();
UIViewRoot uiViewRoot = facesContext.getViewRoot();
if (getCancelButton(uiViewRoot) == null)
oldViewId = uiViewRoot.getViewId();
}
示例3: addTokenToViewIdMap
import javax.faces.component.UIViewRoot; //導入方法依賴的package包/類
/**
* In order to provide human readable information there is a map which
* has token to viewId information.
*
* Add the token passed in and associate it in the map with the current view id.
*
* This method should only be called when debugTokenCache() is true
*/
public static void addTokenToViewIdMap(String token)
{
if (!_DEBUG_TOKEN_CACHE)
throw new UnsupportedOperationException(_UNSUPPORTED_OPERATION_MESSAGE);
FacesContext context = FacesContext.getCurrentInstance();
Map<String,String> tokenToViewIdMap = _getTokenToViewIdMap(context);
UIViewRoot root = context.getViewRoot();
String viewId = root.getViewId();
tokenToViewIdMap.put(token, viewId);
StringBuffer logBuffer = _getLogBuffer(context);
logBuffer.append("\nADDING ").append(_getTokenToViewIdString(tokenToViewIdMap, token));
}
示例4: _getViewId
import javax.faces.component.UIViewRoot; //導入方法依賴的package包/類
private String _getViewId(FacesContext context)
{
UIViewRoot viewRoot = context.getViewRoot();
if (viewRoot != null)
return viewRoot.getViewId();
return null;
}
示例5: afterPhase
import javax.faces.component.UIViewRoot; //導入方法依賴的package包/類
@Override
public void afterPhase(PhaseEvent event)
{
FacesContext facesContext = event.getFacesContext();// saber em que pagina se encontra
UIViewRoot uiViewRoot = facesContext.getViewRoot();// devolve a página atual
String paginaAtual = uiViewRoot.getViewId();
boolean paginaAutenticacao = paginaAtual.contains("index.xhtml");
boolean paginaAcessoNegado = paginaAtual.contains("denied.xhtml");
boolean paginaNoPagina = paginaAtual.contains("error-404.xhtml");
boolean paginaNovoSeguroApolice = paginaAtual.contains("GestSeg_NovoSeguroApolice.xhtml");
boolean paginaNovoSeguro = paginaAtual.contains("GestSeg_NovoSeguro.xhtml");
boolean paginaSegContrato = paginaAtual.contains("GestSeg_Contratos.xhtml");
if(SessionUtil.obterValor(Funcionario.SESSION_NAME) != null)
{
if(SessionUtil.getUserlogado().getNivelAcesso().equals("3") || SessionUtil.getUserlogado().getIdDepartamento().equals("5"))
RequestContext.getCurrentInstance().execute("menuAnalista('"+SessionUtil.getUserlogado().getIdDepartamento()+"')");
else if(SessionUtil.getUserlogado().getNivelAcesso().equals("2") || SessionUtil.getUserlogado().getNivelAcesso().equals("5") )
RequestContext.getCurrentInstance().execute("admOperario()");
else
RequestContext.getCurrentInstance().execute("passado()");
}
if(!paginaSegContrato){ MarcaDAgua.isCanceled = false; }
if(!paginaAutenticacao && SessionUtil.obterValor(Funcionario.SESSION_NAME) == null)
Validacao.redirecionar("../index.xhtml");
if(!paginaNovoSeguro&&!paginaNovoSeguroApolice)
sharchSessaoRemove();
}
示例6: saveView
import javax.faces.component.UIViewRoot; //導入方法依賴的package包/類
@SuppressWarnings("deprecation")
@Override
public Object saveView(FacesContext context)
{
assert(context != null);
// see if a view has been saved on the request
Object viewState = _getCachedViewState(context);
if (viewState != null)
{
// TODO gcrawfor
// when is this not null, meaning when is saveView being called multiple times
// per request?
return viewState;
}
// if the root is transient don't state save
UIViewRoot viewRoot = context.getViewRoot();
if (viewRoot.isTransient())
{
return null;
}
String viewId = viewRoot.getViewId();
StateManagementStrategy sms = _getStateManagementStrategy(context, viewId);
Map<Object, Object> contextAttributes = context.getAttributes();
try
{
contextAttributes.put(StateManager.IS_SAVING_STATE, Boolean.TRUE);
if (sms != null)
{
// Force view root to use full state saving
// This is necessary because we recreate the view root on postback when view root caching
// is enabled and assume that that we can apply the full state
if (_useViewRootCache(context, RequestContext.getCurrentInstance()))
{
viewRoot.clearInitialState();
}
viewState = sms.saveView(context);
}
else
{
// if there's no stateManagementStrategy handle saving the state ourselves
_removeTransientComponents(viewRoot);
Object structure = !_needStructure(context) ? null : new Structure(viewRoot);
Object state = viewRoot.processSaveState(context);
viewState = new Object[]{structure, state};
}
}
finally
{
contextAttributes.remove(StateManager.IS_SAVING_STATE);
}
if (_saveAsToken(context, false))
{
viewState = _saveStateToCache(context, viewState, viewRoot);
}
_saveCachedViewState(context, viewState);
return viewState;
}