简体   繁体   中英

Rich Picklist + A4j Support + onlistchange

There are a weird behavior happening when I use rich picklist component attached to an a4j support onlistchange event.

If I have "n" selected items into picklist component, the server will try to populate it "n" times (running gruposDeTributosQuery.resultListOrdered() "n" times!!!)! This causes a hard delay, because the query used to populate is a little bit slower... Above is my code:

<rich:pickList id="picklisttributos" value="#{criarEstudo.tributosDoAssuntoList}"
label="Tributos" >
<s:selectItems var="_tributos" value="#{gruposDeTributosQuery.resultListOrdered}"
label="#{_tributos.nome} | #{_tributos.id}" />
<s:convertEntity />
<a4j:support event="onlistchange" process="picklistOF" reRender="picklistOF" />
</rich:pickList>

Bizarre. New discover... The problem is gruposDeTributosQuery.resultListOrdered!

 public List<Tributo> getResultListOrdered() {
    this.setOrder("nome");
    //ArrayList<Tributo> lista = new ArrayList<Tributo>(
    //      this.getResultList());
    return this.getResultList();
  }

If I use direclty resultList this bahavior doesn´t happen!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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