Gmail Calendar Docs Reader La Web Más »
Grupos visitados recientemente | Ayuda | Acceder
Página principal de Grupos de Google
JSF Newbie and the Converters
En este grupo hay demasiados temas que deben mostrarse primero. Para que este aparezca al principio de la lista, debes descartar esta opción para alguno de los anteriores.
Error al procesar tu solicitud. Por favor, inténtalo de nuevo.
marcar
  1 mensaje - Ocultar todos  -  Traducir todo al Traducido (ver todos los originales)
El grupo al cual envías entradas es un grupo Usenet. Si envías mensajes a este grupo, cualquier usuario de Internet podrá ver tu dirección de correo electrónico
Tu respuesta no se ha enviado.
Tu entrada se ha publicado correctamente.
 
De:
Para:
Cc:
Seguimiento:
Añadir Cc | Añadir seguimiento | Editar asunto
Asunto:
Validación:
Con fines de verificación, escribe los caracteres que veas en la imagen siguiente o los números que escuches haciendo clic en el icono de accesibilidad. Escucha y escribe los números que oyes.
 
Ilya Dyoshin  
Ver perfil   Traducir al Traducido (ver original)
 Más opciones 29 ago, 06:20
De: Ilya Dyoshin <idyos...@gmail.com>
Fecha: Sat, 29 Aug 2009 04:20:41 -0700 (PDT)
Local: Sáb 29 ago 2009 06:20
Asunto: JSF Newbie and the Converters
Good day.

I'm pretty new to JSF so maybe the question is obvious But I've
googled for 3 hours and found no solution.

I'm developing proto JSF application with JPA (as the point of
integration I'm using Spring managed beans in the JSF context).

There is a need to create the input for JPA object which references
the another. I've created the following  converter:

public class SprPolConverter implements Converter {

    private ISprPolDAO getDao(FacesContext context) {
        return (ISprPolDAO) FacesContextUtils.getWebApplicationContext
(context).getBean("sprPolDAO");
    }

    @Override
    public Object getAsObject(FacesContext arg0, UIComponent arg1,
String id) {
        if (id == null )
            return null;

        Long _id = new Long(id);
        return getDao(arg0).getById(_id);
    }

    @Override
    public String getAsString(FacesContext arg0, UIComponent arg1,
Object obj) {
        if (obj == null )
            return null;

        return "" + ((SprPol )obj).getId();
    }

}

and registered it as the  default converter for type
    <converter>
        <converter-for-class>com.uniqa.persistence.spr.common.SprPol</
converter-for-class>
        <converter-
class>com.uniqa.ui.converters.spr.common.SprPolConverter</converter-
class>
    </converter>

It's used anytime I submit the form - and returns the correct values
(looking in the logs - everything returned from converter is fine).

But I always receive the Validation error: Value is not valid....

any idea?

Best regards,
Ilya Dyoshin.


    Responder al autor    Reenviar  
Debes registrarte antes de enviar mensajes.
Para enviar una entrada, antes deberás formar parte del grupo.
Antes de enviar entradas, actualiza tu alias en la configuración de la suscripción.
No dispones del permiso necesario para enviar entradas.
Fin de los mensajes
« Volver a “Debates” « Tema más reciente     Tema anterior »

Crear un grupo - Grupos de Google - Página principal de Google - Condiciones del servicio - Política de privacidad
©2009 Google