的
<f:ajax>唯一电流分量(处理由默认的读取描述
execute属性)。基本上,您的代码与此完全相同:
<h:form> <h:commandButton action="nothing"> <f:ajax execute="@this" render="num"/> </h:commandButton> <h:inputText value="#{helper.randomize}" id="num"/></h:form><h:commandButton action>实际上,仅处理,而
<h:inputText value>(以及任何其他输入字段,如果有)被完全忽略。
您需要更改
execute属性,以明确指定要在ajax请求期间处理的组件或部分。通常,为了处理整个表格,
@form使用了:
<h:form> <h:commandButton action="nothing"> <f:ajax execute="@form" render="num"/> </h:commandButton> <h:inputText value="#{helper.randomize}" id="num"/></h:form>也可以看看:
- 在JSF 2.0通信 - 的Ajax(异步)POST形式
- 未调用commandButton / commandlink / ajax操作/侦听器方法或未更新输入值(点8)
- 了解PrimeFaces流程/更新和JSF f:ajax执行/渲染属性



