1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
@FacesConverter(value="devisStatutConverter")
public class DevisStatutConverter implements Converter
{
@Override
public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String value)
{
try
{
DevisStatut devisStatut = DevisVPIEJBLocator.getInstance().getDevisVPIFacadeLocal().getDevisStatutByCode(value);
return devisStatut;
}
catch (Exception e)
{
System.out.println(e.toString());
}
return null;
}
@Override
public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object o)
{
if (o == null)
{
return null;
}
if (o instanceof DevisStatut)
{
return ((DevisStatut)o).getCode().toString();
}
return o.toString();
}
} |
Partager