Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Primefaces 3.3.1 picklist performance is slow

I recently updated my primefaces-project to the new version of primefaces.

Everything seems to work fine but the picklist is very slow when clicking the "add all"-button. I have a huge data-set (about 130 items) in the list. The problem is also described in this forum post.

UPDATE: A very basic example should demonstrate the problem:

<p:pickList value="#{testForm.dualList}"
            var="id"
            itemLabel="#{id}"
            itemValue="#{id}" />

The form (in session scope):

@Component("testForm")
@Scope("session")
public class TestForm implements Serializable {
     private DualListModel<Integer> dualList;
     //getter & setter methods
}

Method which creates the DualListModel:

prepareForm() {
    List<Integer> source = Lists.newLinkedList();
    List<Integer> target = Lists.newLinkedList();
    //add 100 integers as source:
    for(int i = 0; i <= 99; i++) {
       source.add(i);
    }

    DualListModel<Integer> model = new DualListModel<Integer>(source, target);
    testForm.setDualList(model);
}

Is there something i could do to make it faster?

like image 721
CSan Avatar asked Jul 06 '12 16:07

CSan


1 Answers

It seems to be a bug in primefaces-version. I have found a few other posts in the primefaces forum about this topic.

I have implemented my own picklist and everything works fine now.

like image 115
CSan Avatar answered Oct 11 '22 14:10

CSan