Adding an object to a table, and setting it to editable

I add an object to my table and when I make the table editable I get the following error:

“Unable to convert value of type com.tds.team.partmaster.FieldOptionObj to presentation type class java.lang.String. No converter is set and the types are not compatible.”

What do i need to do in the FieldOptionObj class to let it be editable? All I need is it’s string value to be editable.


Here
and

here

Great thanks, I’ll try that.

For anyone wondering what my class looked like here it is. Slightly different than the example because I needed to keep a primary key along with the object.

public class StringFieldConverter implements Converter<String, FieldOptionObj>
{
    FieldOptionObj newFoptObj;
    public StringFieldConverter(int optionpk, String displayStr)
    {
        newFoptObj = new FieldOptionObj(optionpk, displayStr);
        
    }
    
    public FieldOptionObj convertToModel(String text,Class<? extends FieldOptionObj> targetType, Locale locale)
        throws ConversionException
        {
            if(text == null)
            {
                return null;
            }
            newFoptObj.setDisplayStr(text);
            return newFoptObj;
        }
    
        

    
    
    public String convertToPresentation(FieldOptionObj foptObj,
            Class<? extends String> targetType, Locale locale)
        throws ConversionException
        {
            if(foptObj == null)
            {
                return null;
            }
            
            return foptObj.getDisplayStr();
        }
    
        
    public Class<FieldOptionObj> getModelType()
    {
        return FieldOptionObj.class;
    }
    
    public Class<String> getPresentationType()
    {
        return String.class;
    }    
    
}