我正在處理Primefaces社區(5.1)的最新版本中的一個問題。將它與JSF 2.1.29和+1000元素結合使用會在使用Google Chrome 38瀏覽器時帶來可怕的性能問題,無論是視圖加載和元素轉移。我擔心這是Chrome的Javascript引擎中的一個問題。在這裏,您已經有了一個非常基本的用例:在Chrome瀏覽器中有大量元素的PickList變慢了
@ManagedBean
@ViewScoped
public class PickListTestBean implements Serializable {
private DualListModel<String> values;
public PickListTestBean() {
List<String> source = new ArrayList<String>();
List<String> target = new ArrayList<String>();
for (int i = 0; i < 1000; i++) {
source.add("value" + i);
}
values = new DualListModel<String>(source, target);
}
public DualListModel<String> getValues() {
return values;
}
public void setValues(DualListModel<String> values) {
this.values = values;
}
}
和視圖:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:p="http://primefaces.org/ui"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head />
<h:body>
<h:form>
<p:pickList value="#{pickListTestBean.values}" var="val"
effect="none" itemValue="#{val}" itemLabel="#{val}"
showSourceFilter="true" showTargetFilter="true">
<p:column>
#{val}
</p:column>
</p:pickList>
</h:form>
</h:body>
</html>
這是正常的FF和IE瀏覽器最新版本的工作...