2
I have the following piece of code:
<p:menuButton value="#{messages['relatorio']}">
<p:menuitem value="PDF" update="painelRelatorioResumoExpedicaoDesembarque" oncomplete="gerarRelatorio();" id="commandButtonGerarRelatorio" action="#{executarServicoController.executarServicoHelper}" ajax="true">
<f:setPropertyActionListener target="#{executarServicoPreenchendoParametrosExecutarForm.parametros.paramsHelper.idUnidadeResponsavelCarga}" value="#{appHelper.idUnidadeResponsavelCorrente}" />
<f:setPropertyActionListener target="#{executarServicoPreenchendoParametrosExecutarForm.parametros.paramsHelper.idUnidadeOperacaoCarga}" value="#{appHelper.idUnidadeOperacaoCorrente}" />
<f:setPropertyActionListener target="#{executarServicoPreenchendoParametrosExecutarForm.serviceBean}" value="modalService" />
<f:setPropertyActionListener target="#{executarServicoPreenchendoParametrosExecutarForm.serviceMethod}" value="obterDadosRelatoriosMovimentacaoImportacao" />
<f:param name="tipoRelatorio" value="pdf" />
</p:menuitem>
<p:menuitem value="XLS" update="painelRelatorioResumoExpedicaoDesembarque" oncomplete="gerarRelatorio();" id="commandButtonGerarRelatorios" action="#{executarServicoController.executarServicoHelper}" ajax="true">
<f:setPropertyActionListener target="#{executarServicoPreenchendoParametrosExecutarForm.parametros.paramsHelper.idUnidadeResponsavelCarga}" value="#{appHelper.idUnidadeResponsavelCorrente}" />
<f:setPropertyActionListener target="#{executarServicoPreenchendoParametrosExecutarForm.parametros.paramsHelper.idUnidadeOperacaoCarga}" value="#{appHelper.idUnidadeOperacaoCorrente}" />
<f:setPropertyActionListener target="#{executarServicoPreenchendoParametrosExecutarForm.serviceBean}" value="modalService" />
<f:setPropertyActionListener target="#{executarServicoPreenchendoParametrosExecutarForm.serviceMethod}" value="obterDadosRelatoriosMovimentacaoImportacao" />
<f:param name="tipoRelatorio" value="xls" />
</p:menuitem>
</p:menuButton>
Notice that there are 2 <p:menuitem>
where the only difference is that <f:param
i define value differently. Is there any way to simplify and leave everything in a block for example ?