嗨,我目前正在使用 primefaces 开发一个 java 项目 (jsf),并且我正在使用枚举,但我无法使用 primefaces 从视图中访问它的值。我已经通过从 Bean 创建一个 getter 并访问枚举值暂时解决了这个问题,但它应该默认使用 allSuffix = "ALL_ENUM_VALUES" 或 ALL_VALUES,我不知道这是否是 primefaces、joinfaces 或我的问题我失踪了。我已经查看了官方文档,它应该可以工作......任何解决方案?
我的代码是
<p:importEnum
type="com.path.enumeration.AltoMedioBajo"
var="AltoMedioBajo"
allSuffix="ALL_ENUM_VALUES" />
<p:outputLabel
for="posibilidad"
value="#{informe_msg.posibilidad}" />
<p:selectOneMenu
id="posibilidad"
style="width: 150px"
value="#{informeSeguimientoDto.specification.posibilidad}">
<f:selectItem
itemLabel=""
itemValue="" />
<f:selectItems
value="#{AltoMedioBajo.ALL_ENUM_VALUES}"
var="posibilidad"
itemValue="#{posibilidad}"
itemLabel="#{peticion_msg[posibilidad.femKey]}" />
</p:selectOneMenu> ```