Interface IComponentValueConverter<ExternalValue,​ComponentValue>

  • Type Parameters:
    ExternalValue - Type of the external value, usually the value used by the backing bean.
    ComponentValue - Type of the value required by the JSF or PF component.
    All Known Implementing Classes:
    DurationPartsConverter, TypePartsConverter

    public interface IComponentValueConverter<ExternalValue,​ComponentValue>
    Used with the composite component convertible. Lets you convert between a bean value and the value that is used for the component or components. For example, you could have a bean property date, of type Date. If you want to have three different input fields, one for the year, one for the month, and one for the day, you can use the convertible composite component. This way you do not have to add new bean properties for the year, month, and date, which would require you to keep them in sync with the original date object. See ConvertibleComponent for an example.
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • externalToComponentValue

        IConvertibleMap<ComponentValue> externalToComponentValue​(ExternalValue value)
        Parameters:
        value - The value on the backing bean or the model.
        Returns:
        A map of values to be used on the component. In your xhtml, you can use the key you assign here to access the value.
      • componentToExternalValue

        ExternalValue componentToExternalValue​(IConvertibleMap<ComponentValue> componentValues)
        Parameters:
        componentValues - The value on the component.
        Returns:
        The value to be set on the backing bean or model.
      • newConvertibleMap

        default IConvertibleMap<ComponentValue> newConvertibleMap()
        Returns:
        A new, empty convertible map. Used as the default when none is avaiable yet.