究竟是什么process,并update在PrimeFaces p:commandXxx组件和execute和render的f:ajax标签?
哪个在验证时有效?什么是update属性做,而不是更新的值从后端组件?不要process属性绑定值模型?究竟是什么@this,@parent,@all并@form在这两个属性?
下面的例子工作正常,但我对基本概念有点困惑.
<p:commandButton process="@parent"
update="@form"
action="#{bean.submit}"
value="Submit" />
Run Code Online (Sandbox Code Playgroud) 我将我的<h:commandButton>标签更改<p:commandButton>为搜索页面上的PrimeFaces 标签,我的数据表停止显示结果.添加update属性后,事情再次起作用.我只是想了解它是如何实现整体功能(viewscope,action vs actionListener等)还是update真正需要的属性?
<h:form id="search_form">
<p:inputText id="search" value="#{searchBean.searchString}" />
<p:commandButton update="search_form" value="Search" action="#{searchBean.searchByString}" >
</p:commandButton>
<p:dataTable id="output" var="res" value="#{searchBean.results}" emptyMessage="No results found with given criteria">
etc...
Run Code Online (Sandbox Code Playgroud)
@ViewScoped
@ManagedBean
public class SearchBean {
@Inject
private SearchRepository searchRepository;
private List<Results> res;
private String searchString;
public SearchBean() {
}
public String searchByString()
{
this.setRes(searchRepository.searchBySingleString(searchString));
}
Run Code Online (Sandbox Code Playgroud)