Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Primefaces 5.0数据克隆和分页_Java_Jsf 2_Primefaces - Fatal编程技术网

Java Primefaces 5.0数据克隆和分页

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

我有一个primefaces datascroller,我用它来显示一个简单的列表和一组可以过滤该列表的过滤器

一切都在RequestScoped bean上,我尽量避免使用视图/会话bean,因为它是一个b2c站点,应该有很多访问者

我的问题是,当我过滤列表时,一切正常,但当我向下滚动时,过滤器状态丢失(过滤器没有在bean中设置)

我几乎可以肯定这是因为datascroller使用了一个部分进程(javax.faces.partial.execute),所以过滤器不会被处理。。。但datascroller对此没有选择。有什么想法吗


谢谢

我终于用又快又脏的方式完成了。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)
}