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


Java FacesContext.getPartialViewContext方法代码示例

本文整理汇总了Java中javax.faces.context.FacesContext.getPartialViewContext方法的典型用法代码示例。如果您正苦于以下问题:Java FacesContext.getPartialViewContext方法的具体用法?Java FacesContext.getPartialViewContext怎么用?Java FacesContext.getPartialViewContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.faces.context.FacesContext的用法示例。


在下文中一共展示了FacesContext.getPartialViewContext方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processAction

import javax.faces.context.FacesContext; //导入方法依赖的package包/类
/**
 * Handle the reset input action as follows, only and only if the current request is an ajax request and the
 * {@link PartialViewContext#getRenderIds()} does not return an empty collection nor is the same as
 * {@link PartialViewContext#getExecuteIds()}: find all {@link EditableValueHolder} components based on
 * {@link PartialViewContext#getRenderIds()} and if the component is not covered by
 * {@link PartialViewContext#getExecuteIds()}, then invoke {@link EditableValueHolder#resetValue()} on the
 * component.
 * @throws IllegalArgumentException When one of the client IDs resolved to a <code>null</code> component. This
 * would however indicate a bug in the concrete {@link PartialViewContext} implementation which is been used.
 */
@Override
public void processAction(ActionEvent event) throws AbortProcessingException {
	FacesContext context = FacesContext.getCurrentInstance();
	PartialViewContext partialViewContext = context.getPartialViewContext();

	if (partialViewContext.isAjaxRequest()) {
		Collection<String> renderIds = getRenderIds(partialViewContext);

		if (!renderIds.isEmpty() && !partialViewContext.getExecuteIds().containsAll(renderIds)) {
			context.getViewRoot().visitTree(createVisitContext(context, renderIds, VISIT_HINTS), VISIT_CALLBACK);
		}
	}

	if (wrapped != null && event != null) {
		wrapped.processAction(event);
	}
}
 
开发者ID:phoenixctms,项目名称:ctsms,代码行数:28,代码来源:ResetInputAjaxActionListener.java


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