selectmanymenu

How do UISelectOne and UISelectMany components preselect defaults in f:selectItems

非 Y 不嫁゛ 提交于 2019-12-17 03:19:18
问题 I know how to preselect <p:selectOneMenu> , in selected value should be one of the objects from <f:selectItems> , but how does this component work under the hood and can I change this behavior? In my case I've a duplicate object, actually this is two objects with the same values but created twice and selected object in <p:selectOneMenu> differs from object from <f:selectItems> and it doens't recognize it. Most likely I will change my design so, it will point to same object but in case I can't

UISelectMany in ui:repeat causes java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to java.util.List

萝らか妹 提交于 2019-12-05 18:50:11
I have used the HashMap method for binding a list of checkboxes to a Map<String, Boolean> with success. This is nice since it allows you to have a dynamic number of checkboxes. I'm trying to extend that to a variable length list of selectManyMenu . Being that they are selectMany, I'd like to be able to bind to a Map<String, List<MyObject>> . I have a single example working where I can bind a single selectManyMenu to a List<MyObject> and everything works fine, but whey I put a dynamic number of selectManyMenus inside a ui:repeat and attempt to bind to the map, I end up with weird results. The

How to get all the selected values from selectManyListbox / selectManyMenu / selectManyCheckbox?

こ雲淡風輕ζ 提交于 2019-11-27 15:43:28
How do I collect all selected values from UISelectMany components such as h:selectManyListbox, h:selectManyMenu, h:selectManyCheckbox, p:selectManyListbox, p:selectManyMenu, p:selectManyCheckbox, etc in backing bean? If someone can help with an example, that would really help. BalusC As with every other input component, just bind its value attribute with a managed bean property. It can map to a List or an array of the same value type as you've used in f:selectItem(s) . If the value type is not one of the standard EL types ( String , Number or Boolean ), then you have to supply a Converter as

org.hibernate.LazyInitializationException at com.sun.faces.renderkit.html_basic.MenuRenderer.convertSelectManyValuesForModel

一世执手 提交于 2019-11-27 08:24:28
Despite of FetchType.EAGER and JOIN FETCH , I get a LazyInitalizationException while adding some objects to a @ManyToMany collection via a JSF UISelectMany component such as in my case the <p:selectManyMenu> . The @Entity IdentUser , with FetchType.EAGER : @Column(name = "EMPLOYERS") @ManyToMany(fetch = FetchType.EAGER, cascade= CascadeType.ALL) @JoinTable(name = "USER_COMPANY", joinColumns = { @JoinColumn(name = "USER_ID") }, inverseJoinColumns = { @JoinColumn(name = "COMPANY_ID") }) private Set<Company> employers = new HashSet<Company>(); The @Entity Company , with FetchType.EAGER :

How to get all the selected values from selectManyListbox / selectManyMenu / selectManyCheckbox?

拟墨画扇 提交于 2019-11-26 18:33:05
问题 How do I collect all selected values from UISelectMany components such as h:selectManyListbox, h:selectManyMenu, h:selectManyCheckbox, p:selectManyListbox, p:selectManyMenu, p:selectManyCheckbox, etc in backing bean? If someone can help with an example, that would really help. 回答1: As with every other input component, just bind its value attribute with a managed bean property. It can map to a List or an array of the same value type as you've used in f:selectItem(s) . If the value type is not

org.hibernate.LazyInitializationException at com.sun.faces.renderkit.html_basic.MenuRenderer.convertSelectManyValuesForModel

百般思念 提交于 2019-11-26 14:08:14
问题 Despite of FetchType.EAGER and JOIN FETCH , I get a LazyInitalizationException while adding some objects to a @ManyToMany collection via a JSF UISelectMany component such as in my case the <p:selectManyMenu> . The @Entity IdentUser , with FetchType.EAGER : @Column(name = "EMPLOYERS") @ManyToMany(fetch = FetchType.EAGER, cascade= CascadeType.ALL) @JoinTable(name = "USER_COMPANY", joinColumns = { @JoinColumn(name = "USER_ID") }, inverseJoinColumns = { @JoinColumn(name = "COMPANY_ID") }) private