我需要本地化selectOneMenu
中的项目。但是,不是采用变量的标签,而是显示项目的价值。
辅助bean包含以下内容:
private static final String[] UPGRADE = { "Standard", "Privilege", "Basic" };
private static final String[] UPGRADE_LABELS = {Resource.getMessage("lblStandard"), Resource.getMessage("lblPrivilege"), Resource.getMessage("lblBasic")};
for(int i = 0;i<UPGRADE.length;i++) {
String value = UPGRADE[i];
String label = UPGRADE_LABELS[i];
item = new SelectItem(value, label);
allLevelStatus.add(item);
}
这是xhtml部分:
<h:selectOneMenu style="width:125px; font-size:12px;" id="selectstatusTypePro"
value="#{startNotificationBean.levelStatus}" disabled="#{startNotificationBean.editUpdate}">
<f:selectItem itemLabel="#{msg['lblAny']}" itemValue="Any" />
<f:selectItems value="#{startNotificationBean.allLevelStatus}"/>
</h:selectOneMenu>