Why are multiple transducers not allowed on the same value holder?

This morning I had a reason to try using several converters on the inputText component and realized that this did not work.

Anyone who uses JSF with only one converter for ValueHolder? It seems that using multiple converters would be elegant in several situations.

+3
source share
1 answer

In JSF, the interface is Converterdesigned for the sole purpose of:

- , Java, Object-to-Object String-to-Object , .

...

getAsObject , UIComponent, , " " .

getAsString , UIComponent, , , .

javadoc, JSF .

. , , super. .

public class SomeExtendedConverter extends SomeBasicConverter {

    @Override
    public Object getAsObject(FacesContext context, UIComponent component, String value) {
        Object basicConvertedValue = super.getAsObject(context, component, value);

        // ... manipulate more ...

        return extendedConvertedValue;
    }

    // ...
}
+10

All Articles