📜  RichFaces部分视图更新

📅  最后修改于: 2021-01-08 12:15:00             🧑  作者: Mango

部分视图更新

我们可以使用render属性来指定要为Ajax更新呈现的组件。 render属性可以指向要更新的特定组件的ID标识符。也可以通过使用表达语言(EL)来识别组件。

render属性接受以下关键字:

Keyword Function
@all It is used to update every component.
@none It is used for no components are updated.
@this It is used for requesting component with the execute attribute is updated.
@form It is used to update the form that contains the requested component.
@region The region that contains the requesting component is updated. Use the component as a wrapper element to specify regions.

我们应该通过设置ajaxRendered =“ true”使用组件。

组件基于组件,因此也将始终进行更新。若要覆盖此行为,请在请求组件上使用limitRender =“ true”设置。

// index.xhtml





Partial View Update










// User.java

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
@ManagedBean
@RequestScoped
public class User {
String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

输出: