p:dataTable rowEdit不更新行对象 [英] p:dataTable rowEdit doesn't update row object
问题描述
我正在尝试使用rowEdit模式编辑datatable上的行,但对我来说不起作用。
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.
有人对此有疑问吗?
提前感谢您的帮助
推荐答案
最后我发现我做错了。
方法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屋!