Primefaces 3.5 + OmniFaces 1.3 SelectItemsIndexConverter issue with SelectOneMenu

只愿长相守 提交于 2019-12-01 20:40:53

I can reproduce it. It's a bug in PrimeFaces. This problem is not related to the converter. The problem is just caused by PrimeFaces-specific JavaScript code which incorrectly redisplays the value of the selected option instead of the label of the selected option after "unedit".

This is more easily to be reproduced as follows:

<p:selectOneMenu value="#{insurancepolicy.branchAsString}">                      
    <f:selectItems value="#{insurancepolicybean.branchMap}" />
</p:selectOneMenu>

with

private Map<String, String> branchMap;

@PostConstruct
public void init() {
    branchMap = new LinkedHashMap<String, String>();
    branchMap.put("branch label 1", "branch value 1");
    branchMap.put("branch label 2", "branch value 2");
    branchMap.put("branch label 3", "branch value 3");
}

I recommend to report it to PrimeFaces guys.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!