简体   繁体   English

Primefaces移动数据列表liveScroll无法正常工作

[英]Primefaces mobile dataList liveScroll not working

I'm using Primefaces mobile and I've created a dataList to display my database information. 我正在使用Primefaces mobile,并创建了一个dataList来显示我的数据库信息。 But I need to make it so that it has liveScroll, meaning, I can keep scrolling down and once I hit a certain number of records displayed (I've set it to 3 here) a button should appear saying "More Results" that would load more results. 但是我需要使其具有liveScroll,这意味着我可以继续向下滚动,一旦我击中显示的一定数量的记录(在此处将其设置为3),就会出现一个按钮,显示“更多结果”,加载更多结果。 I know it's possible, I've seen it here: http://forum.primefaces.org/viewtopic.php?f=8&t=30479&p=98383#p98383 我知道这是可能的,我已经在这里看到了: http : //forum.primefaces.org/viewtopic.php?f=8&t=30479&p=98383#p98383

But for me it's not working, it just displays the full dataList with all the database records instead of just showing 3 at a time like I set it to. 但是对我来说,它不起作用,它只显示包含所有数据库记录的完整dataList,而不是像我设置的那样一次只显示3。

<p:dataList id="dataList" value="#{search.dbRecord}" var="record" paginator="true" rows="3" >
             <f:attribute name="paginatorText" value="More Results" />
             <p:column>
             <h:outputLink value="#">

                 <h2>#{record.name}</h2>
                 <h2>#{record.number}</h2>

             </h:outputLink>
             </p:column>
</p:dataList>

What am I doing wrong? 我究竟做错了什么?

EDIT: Turns out this functionality is still not working in Primefaces 5.0 so I used Primefaces mobile 0.9.4 编辑:原来此功能在Primefaces 5.0中仍然不起作用,所以我使用了Primefaces mobile 0.9.4

which version of PrimeFaces are you using ? 您正在使用哪个版本的PrimeFaces?

Edit : 编辑:

PrimeFaces Mobile 0.9.4 PrimeFaces Mobile 0.9.4

Download with Maven : 用Maven下载:

Group id of the dependency is org.primefaces and artifact id is primefaces-mobile: 依赖项的组标识为org.primefaces,工件标识为primefaces-mobile:

<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces-mobile</artifactId>
<version>0.9.4</version>
</dependency>

In addition to the configuration above you also need to add PrimeFaces maven repository to the repository list so that maven can download it : 除了上述配置之外,您还需要将PrimeFaces maven存储库添加到存储库列表中,以便maven可以下载它:

 <repository>
    <id>prime-repo</id>
    <name>Prime Repo</name>
    <url>http://repository.primefaces.org</url>
    </repository>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM