当前位置: 首页>>代码示例>>Java>>正文


Java UIViewRoot.getViewId方法代码示例

本文整理汇总了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);
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:34,代码来源:FredJSP.java

示例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();
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:8,代码来源:BackButton.java

示例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));
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:23,代码来源:TokenCacheDebugUtils.java

示例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;
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:9,代码来源:PreferencesProxy.java

示例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();
}
 
开发者ID:JIGAsoftSTP,项目名称:NICON,代码行数:31,代码来源:AutenticacaoPhaseListener.java

示例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;
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:70,代码来源:StateManagerImpl.java


注:本文中的javax.faces.component.UIViewRoot.getViewId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。