本文整理汇总了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);
}
}