public List<SelectItem> getClienteList() { List<Cliente> clienteList = clienteJPAController.findAllEntities(); List<SelectItem> resultList = new ArrayList<SelectItem>(); resultList.add(new SelectItem(null, Messages.getLocalizedString("COMMON_SELECTONEITEM"))); for (Cliente cliente : clienteList) { resultList.add(new SelectItem(cliente.getId(), cliente.getRazonSocial())); } return resultList; }
public Cliente getClienteSelected() { if (clienteSelected == null || (clienteSelected != null && !clienteSelected.getId().equals(clienteId))) { if (clienteId != null) { clienteSelected = clienteJPAController.findById(clienteId); } } return clienteSelected; }