RichFaces a4j:支持应该在上下文中更新模型,而不是实体

前端之家收集整理的这篇文章主要介绍了RichFaces a4j:支持应该在上下文中更新模型,而不是实体前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个h:inputTextarea和一些a4j:支持按需更新模型
<h:inputTextarea rows="15" id="taFreetext" value="#{customInput.value}"
  required="true" 
  onkeyup="textAndLinesCount(#{rich:element('taFreetext')},document.getElementById('msgCounterLines'),20,64);">
     <a4j:support ajaxSingle="true" event="onchange" />
</h:inputTextarea>

我的问题是,当我按下一个键时,不仅我的上下文中的模型被更新,而且实体也会自动刷新!

文件的page.xml具有刷新模式到手动

<begin-conversation join="true" flush-mode="manual"/>

我在Seam Framework论坛中阅读了这篇文章Problems with AJAX and update model,但这并没有真正帮助.
我在a4j中也有一些动作:支持使postManager中创建的entityManager.refresh(),但是模型和实体仍处于旧状态…

期待一些好的提示,谢谢!

(我使用JSF 1.2,RichFaces 3.3.3)

解决方法

使用reRender属性来更新模型,你所做的就是在reRender属性中提到它的id,你将得到结果.
<a4j:support event="onchange" reRender="userRegistrationForm" action="#{UserRegistrationBean.onChangeMenuCountry}"></a4j:support>

猜你在找的Ajax相关文章