I am creating a vehicle control, and in it I have a Fuel register that has description and value, and another cadastre of Supplies. In my supply register has a autoComplete
of Fuel. The problem starts here, when I select the fuel I need to call the cost value that is entered in this fuel.
Example: I selected Diesel.
TOTAL = Valor * LitrosAbastecidos.
However, the Valor
variable is within the Fuel class.
Would anyone have a simple way to solve this?
Note: System made in Java, Hibernate, JSF
Call the Combustible
<p:autoComplete id="combustivel" value="#{abastecimentoControle.abastecimento.combustivel}" completeMethod="#{combustivelControle.listaFiltrando}"
converter="#{combustivelControle.combustivelConverter}"
var="c"
disabled="true"
itemValue="#{c}"
itemLabel="#{c.descricao}"/>
My Filtering List
public List<Combustivel> listaFiltrando(String parte){
System.out.println("Parte: "+parte);
return combustivelFacade.listaFiltrando(parte);
}