p:dataTable rowEdit不更新行对象 [英] p:dataTable rowEdit doesn't update row object

查看:45
本文介绍了p:dataTable rowEdit不更新行对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用rowEdit模式编辑数据表上的行,但对我而言不起作用.

I'm trying to edit rows on datatable using rowEdit mode but it doesn't work for me.

这是rowEdit事件:

Here is the rowEdit event :

<p:ajax event="rowEdit"
        listener="#{saisirHeuresForm.updateMyRow}" 
        update=":saisirHeuresForm:messages"/>

和managedBean对应的方法:

And the managedBean corresponding method :

public void updateMyRow(RowEditEvent event) {
    event.getObject();
}

event.getObject()方法返回与已编辑但未进行任何属性修改的行相对应的对象.

The event.getObject() method returns the object corresponding to the row which is edited but without any property modification.

有人对这个问题有任何想法吗?

Has someone any idea about this problem ?

预先感谢您的帮助

推荐答案

最后,我发现我做错了什么.方法getListItems()一直在从DB加载,因此我修改的项目直接从DB重新加载,在这种情况下,无需修改.

Finally I found what I did wrong. The method getListItems() was all the time loading from DB so the items I modified were directly reloaded from DB and in this case, without the modifcation I did.

希望它可以帮助某人

这篇关于p:dataTable rowEdit不更新行对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆