jsf noSelectionLabel ln selectOneMenu

时间:2011-08-21 10:43:12

标签: jsf

如何在selectOneMenu中使用转换器提供noSelectionLabel?

在selectItem中使用noSelectionLabel在转换器类中使用NullPointerException。

1 个答案:

答案 0 :(得分:3)

如果传入的值为null,只需检入转换器,如果是,则立即返回。

if (value == null) {
    return null;
}

// ...
return convertedValue;