加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-15 22:54:58 所属栏目:百科 来源:网络整理
导读:我有一个h:inputTextarea和一些a4j:支持按需更新模型 h:inputTextarea rows="15" id="taFreetext" value="#{customInput.value}" required="true" onkeyup="textAndLinesCount(#{rich:element('taFreetext')},document.getElementById('msgCounterLines'),
我有一个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>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读