I accidentally found a way to add a method binding as a converter to a component, because I have added a managed bean as a converter directly in the source code. The DDE does not support this.
If you go to the converter property of a component, you can only add one of the predefined converters:
But you can go to the source and add a method binding to the option, in this case my bean which implements my converter functionality.
<xp:inputText
id="inputText1"
value="#{sessionScope.inputText1}"
converter="#{myConverterBean}" />
If you now reopen the saved XPage, the converter property is filled in, but cannot edited / changed anymore.
You must remove the property in the source code to get the old behaviour back.
Tested in 8.5.2, 8.5.3 & ND 9
Interesting. The converter is the whole bean, what method with what signature gets called?
The bean must implement the javax.faces.convert.Converter interface, and the methods getAsObject and getAsString.
Keep in mind that the property is a Value Binding. Your bean can provide a instance of a converter which then can be referenced like this: #{myBean.theValidator}.
I guess the Bean has to be a Managed bean? or is there a possebility to use a static class with only the thwo methods?
Yes, the bean is a managed bean. If you just want to use a static class, you can create your own converter and register it in faces-config.xml.