problem with custom converter and rave components
Hi, i wrote a simple converter (formatter for strings) .
It works fine with standard components ( i.e. outputText and textField from javax.faces.component.html.*).
Is Ignored when i use the same converter with rave components (i.e. staticText, and textfield from com.sun.rave.web.ui.component.*).
I think is ignored because i set breakpoints in the source code of the converter, and the debugger don't stops with com.sun.* components while stops with javax.faces.* components.
I try to use the standard DateTimeConverter and it works fine with both standard and rave components.
I need a different implementation for my converter or must be installed in some way to use it with rave components?
Gianni
The java converter code is :
import javax.faces.context.*;
import javax.faces.component.*;
import javax.faces.convert.Converter;
publicclass CodOrdineConverterimplements Converter, StateHolder{
privateboolean _transient;
publicstaticfinal String CONVERTER_ID ="componenti.CodOrdine";
public CodOrdineConverter(){
}
public Object getAsObject(FacesContext context, UIComponent component, String value){
String retval = (String) value;
return retval;
}
public String getAsString(FacesContext context, UIComponent component, Object value){
String retval;
if ( valueinstanceof String){
retval = (String) value;
}else{
retval = value.toString();
}
if ( retval.length() > 12){
//effettuo la conversione solo se il codice lo permette (in lunghezza)
retval = retval.substring(0, 3) +"." +
retval.substring(3, 8) +"." +
retval.substring(8, 12) +"." +
retval.substring(12);
}elseif ( retval.length() > 2){
retval = retval.substring(0, 2) +"." +
retval.substring(3) ;
}
return retval;
}
//stateholder
publicboolean isTransient()
{
return _transient;
}
publicvoid setTransient(boolean aTransient)
{
_transient = aTransient;
}
publicvoid restoreState(FacesContext facesContext, Object state)
{
Object values[] = (Object[])state;
}
public Object saveState(FacesContext facesContext)
{
Object values[] =new Object[1];
return values;
}
}

