简体   繁体   English

丰富的选择列表+ A4j支持+ onlistchange

[英]Rich Picklist + A4j Support + onlistchange

There are a weird behavior happening when I use rich picklist component attached to an a4j support onlistchange event. 当我使用附加到a4j support onlistchange事件的丰富选择列表组件时,发生一种奇怪的行为。

If I have "n" selected items into picklist component, the server will try to populate it "n" times (running gruposDeTributosQuery.resultListOrdered() "n" times!!!)! 如果我在选择列表组件中选择了“ n”个项目,则服务器将尝试填充“ n”次(运行gruposDeTributosQuery.resultListOrdered()“ n”次!)! 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! 新发现...问题是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! 如果我使用直接结果列表,则此行为不会发生!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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