I have the following code snippet:
<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 is 2 <p:menuitem>
where the only difference is that <f:param
I set the different value. Is there any way to simplify and leave everything in a block for example?