问题描述
我正在尝试使用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不更新行对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!