I have a page with some iteration loops inside my JSF
page and here I would like to know how I can clean up this page attribute after each loop.
To be clearer, I know that when rendering a page sometimes a method is called a few times, then it creates a lista
for example and fills it if it is empty.
public List<Long> buscarLojas() {
if (NullUtil.isNull(this.idsLoja)) {
this.idsLoja = new ArrayList<Long>(this.getPojo().getRelatorioExtratoLojista().keySet());
}
return idsLoja;
}
In the above code this is done, but I would like to know if you have to clean up after exiting the loop ui:repeat
Following my page code, most of the columns are omitted.
<ui:param name="lojas" value="#{bean.buscarLojas()}"/>
<ui:repeat var="loja" value="#{lojas}">
<ui:param name="filiais" value="#{bean.buscarFilial(loja)}" />
<ui:repeat var="filial" value="#{filiais}">
<ui:param name="atendentes" value="#{bean.buscarAtendente(loja, filial)}" />
<ui:repeat var="atendente" value="#{atendentes}">
<ui:param name="propostasStatus" value="#{bean.buscarPropostaStatus(loja, filial, atendente)}" />
<ui:repeat var="propostaStatus" value="#{propostasStatus}">
<ui:param name="objetos" value="#{bean.buscarObjeto(loja, filial, atendente, propostaStatus)}" />
<p:panelGrid
id="panelGridRelatorioExtratoLojista"
styleClass="panelGridCenter gridNoBackground"
style="width: 100%; white-space:nowrap;">
<f:facet name="header">
<p:row>
<p:column styleClass="columnLeft" colspan="12">
<p:outputLabel value="#{bean.criarTituloTabela(objetos[0][4], objetos[0][5], objetos[0][6], objetos[0][3])}"/>
</p:column>
</p:row>
<p:row>
<p:column>
<p:outputLabel value="Classificação"/>
</p:column>
</p:row>
</f:facet>
<ui:repeat var="objeto" value="#{objetos}">
<p:row>
<p:column>
<p:outputLabel value="#{objeto[7]}"/>
</p:column>
</ui:repeat>
</p:panelGrid>
<br/>
</ui:repeat>
</ui:repeat>
</ui:repeat>
</ui:repeat>
The structure that holds the data is this:
private Map<Long, Map<Long, Map<Long, Map<Integer, List<Object>>>>> map;