Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // @Inject
- private Procedimentos procedimentos;
- public IndicacaoConverter() {
- procedimentos = CDIServiceLocator.getBean(Procedimentos.class);
- }
- @Override
- public Object getAsObject(FacesContext context, UIComponent component, String value) {
- Indicacao retorno = null;
- if (value != null) {
- Long id = new Long(value);
- retorno = procedimentos.porId(id);
- }
- return retorno;
- }
- @Override
- public String getAsString(FacesContext context, UIComponent component, Object value) {
- if (value != null) {
- Indicacao indicacao = (Indicacao) value;
- return indicacao.getId() == null ? null : indicacao.getId().toString();
- }
- return "";
- }
- Long id = new Long(value);
Add Comment
Please, Sign In to add comment