是什么A4J之间的区别:outputpanel和A4J:区域? [英] What are the difference between a4j:outputpanel and a4j:region?

查看:434
本文介绍了是什么A4J之间的区别:outputpanel和A4J:区域?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在的问题说,所有的东西是很重要的。当需要使用一个A4J:outputpanel和当A4J:区域

The question says all what is important. When it is necessary to use a a4J:outputpanel and when a4j:region?

推荐答案

该文件说,这一切:

< A4J:地区> 部分指定JSF组件树的一部分,要在服务器上进行处理。该地区导致所有A4J和丰富的Ajax控件来执行:解码,验证和更新模型。该地区导致这些组件,如果没有显式声明甚至执行。这样,处理区域可以更容易地使用声明性的方法的标示。

The <a4j:region> component specifies a part of the JSF component tree to be processed on the server. The region causes all the a4j and rich Ajax controls to execute: decoding, validating, and updating the model. The region causes these components to execute even if not explicitly declared. As such, processing areas can more easily be marked using a declarative approach.

这好比显式命名的执行属性所有部件的操作。拿这个例子:

This is like naming all components explicitly in the execute attribute to an action. Take this example:

<h:inputText id="outerStuff" value="#{bean.blubb}" />
<a4j:region id="innerRegion">
  <h:inputText id="stuff1" value="#{bean.bla}" />
  <h:inputText id="stuff2" value="#{bean.bla2}" />
  <a4j:commandButton action="#{bean.process}" value="click me" />
</a4j:region>

所有三个的commandButton 定义是等价的:

  <a4j:commandButton action="#{bean.process}" value="click me" 
      execute="stuff1,stuff2,@this" />
  <a4j:commandButton action="#{bean.process}" value="click me" 
      execute="@region" />
  <a4j:commandButton action="#{bean.process}" value="click me" />

第三个作品,因为展示文档说:

然而,如果控制缠绕有A4J:区域标记,并没有执行定义,它们使用执行=@区域,而不是

However, if the controls wrapped with the a4j:region tag and have no execute definitions, they use execute="@region" instead.

在对比的是,一个&LT; A4J:outputPanel&GT; 为蓝本的&LT; H:panelGroup中&GT; ajaxRendered 属性的附加功能。如果你离开它,它就像一个 panelGroup中(呈现一个范围 DIV 元素)。如果启用它,它会导致它的内容与每个AJAX请求呈现(除非导致请求的组件被注释 limitRender )。

In contrast to that, an <a4j:outputPanel> is modelled after an <h:panelGroup> with the added feature of the ajaxRendered attribute. If you leave it off, it behaves like a panelGroup (renders a span or div element). If you enable it, it causes it's contents to be rendered with each AJAX request (unless the component causing the request was annotated limitRender).

要总结:&LT; A4J:地区&GT; 如何影响RichFaces的执行视图/更新模型和&LT; A4J:outputPanel&GT; 更改视图呈现方式。

To summarize: <a4j:region> influences how Richfaces executes the view/updates the model and <a4j:outputPanel> changes the way the view is rendered.

这篇关于是什么A4J之间的区别:outputpanel和A4J:区域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆