how to initialize the sales id in print class?

0

I would like to get the id of venda in the print class of the page, and it is null, and I am using it to compare with idvenda with the parameter created in jasper.

impress.html

      <p:commandLink  title="Imprimir" action="#{relatorioMB.emitir}" ajax="false" target="_blank" >
          <i class="fa fa-print"></i> Imprimir teste 
          <f:setPropertyActionListener target="#{vendaMB.venda}" value="#{lin}" />
     </p:commandLink>

I used <f:setPropertyActionListener target="#{vendaMB.venda}" value="#{lin}" /> , but only works on vendaMB .

ImpressionReport.java

     private Venda venda;  parametros.put("idvenda", venda.getIdvenda());

    
asked by anonymous 21.02.2018 / 02:18

1 answer

1

The variable SaleMB MB must be annotated with @ViewScoped.

To capture in MB Impression MB inject the VendaMB.

At ImpressaoMB it would look like this:

@Inject
private VendaMB vendaMB;

public meuMetodo(){
  this.vendaMB.getVenda().getId();
}
    
21.02.2018 / 02:55