Java Primefaces 5.0数据克隆和分页
我有一个primefaces datascroller,我用它来显示一个简单的列表和一组可以过滤该列表的过滤器 一切都在RequestScoped bean上,我尽量避免使用视图/会话bean,因为它是一个b2c站点,应该有很多访问者 我的问题是,当我过滤列表时,一切正常,但当我向下滚动时,过滤器状态丢失(过滤器没有在bean中设置) 我几乎可以肯定这是因为datascroller使用了一个部分进程(javax.faces.partial.execute),所以过滤器不会被处理。。。但datascroller对此没有选择。有什么想法吗Java Primefaces 5.0数据克隆和分页,java,jsf-2,primefaces,Java,Jsf 2,Primefaces,我有一个primefaces datascroller,我用它来显示一个简单的列表和一组可以过滤该列表的过滤器 一切都在RequestScoped bean上,我尽量避免使用视图/会话bean,因为它是一个b2c站点,应该有很多访问者 我的问题是,当我过滤列表时,一切正常,但当我向下滚动时,过滤器状态丢失(过滤器没有在bean中设置) 我几乎可以肯定这是因为datascroller使用了一个部分进程(javax.faces.partial.execute),所以过滤器不会被处理。。。但datas
谢谢我终于用又快又脏的方式完成了。Datascroller似乎没有发送额外参数的选项 (我更改了加载函数,因此进程发送@all而不是this.id)
PF('datascroll').load= function() {
this.loading = true;
this.cfg.offset += this.cfg.chunkSize;
this.loadStatus.appendTo(this.loaderContainer);
if (this.loadTrigger) {
this.loadTrigger.hide()
}
var b = this, a = {source: this.id, process: '@all', update: this.id, global: false, params: [{name: this.id + "_load", value: true}, {name: this.id + "_offset", value: this.cfg.offset}], onsuccess: function(e, c, d) {
PrimeFaces.ajax.Response.handle(e, c, d, {widget: b, handle: function(f) {
this.list.append(f)
}});
return true
}, oncomplete: function() {
b.loading = false;
b.allLoaded = (b.cfg.offset + b.cfg.chunkSize) >= b.cfg.totalSize;
b.loadStatus.remove();
if (b.loadTrigger && !b.allLoaded) {
b.loadTrigger.show()
}
}};
PrimeFaces.ajax.AjaxRequest(a)
}