6
votes

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?

2
And do you mean that in your old primefaces version it was working fine and get slowed once you updated to the new version?fareed
3.3.1 doesn't seems to be a release try with 3.3 instead. Or use older.La Chamelle
@LaChamelle I'm using 3.3.1 and it works finefareed
@fareed It's seems it use with many items. Lodger post your code. May be you compute everytime your list or something else.La Chamelle
I added the code to the question. @fareed yes, everything worked fine with the old version of primefaces.CSan

2 Answers

1
votes

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.

0
votes

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.