CSan
CSan

Reputation: 954

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?

Upvotes: 6

Views: 1797

Answers (2)

CSan
CSan

Reputation: 954

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.

Upvotes: 1

fareed
fareed

Reputation: 3072

I can't tell you the exact problem based on the amount of code you posted here. But based on your comments, I can suggest you the following:

  • Check the required fields inside the same form are not preventing the submit.
  • Don't use nested forms
  • Make sure of your ajax request sequences (actionListener, action, onclick...etc)
  • Make sure your codes are strongly-written and making sense. Because sometimes you will notice strange behavior in primefaces components (not firing, not updating) if your code are resulting in an error.

Hopefully, this can help you.

Upvotes: 0

Related Questions