XPages: Use a Method Binding as Converter

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

Dieser Beitrag wurde unter Java, JSF, XPages abgelegt und mit , , , , , , , verschlagwortet. Setze ein Lesezeichen auf den Permalink.

5 Antworten zu XPages: Use a Method Binding as Converter

  1. Interesting. The converter is the whole bean, what method with what signature gets called?

  2. Michael Saiz sagt:

    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?

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.