selectmanycheckbox

com.sun.faces.renderkit.html_basic.MenuRenderer createCollection: Unable to create new Collection instance for type java.util.Arrays$ArrayList

佐手、 提交于 2019-11-30 13:37:58
I'm trying to use JSF / SelectManyCheckBox tag with an enum : Here is my xhtml code : <h:form id="searchForm"> <h:panelGrid columns="2"> <h:outputText value="Searched queues" /> <h:panelGroup> <h:selectManyCheckbox layout="pageDirection" value="#{jmsErrorController.errorSearchCriteria.searchedQueues}" converter="queueConverter"> <f:selectItems value="#{jmsErrorController.completeQueueList}" /> </h:selectManyCheckbox> </h:panelGroup> </h:panelGrid> <h:commandButton action="#{jmsErrorController.search}" value="Search !" /> </h:form> I've add a converter as stated in an other post. It seems to

How can I get the clicked item in the ajax method?

烈酒焚心 提交于 2019-11-30 07:30:25
问题 Suppose the code of this page: <h:form prependId="false" id="form"> <h:selectManyCheckbox id="checkBoxList" value="#{backedBean.lstIdSelectedItems}" layout="pageDirection"> <f:selectItems value="#{backedBean.lstAvailableItems}" var="item" itemLabel="#{item.label}" itemValue="#{item.value}" /> <f:ajax listener="#{backedBean.itemClicked}" /> </h:selectManyCheckbox> </h:form> And the code of a session managed bean: public class BackedBean implements Serializable { private List<SelectItem>

How can I get the clicked item in the ajax method?

这一生的挚爱 提交于 2019-11-29 04:20:59
Suppose the code of this page: <h:form prependId="false" id="form"> <h:selectManyCheckbox id="checkBoxList" value="#{backedBean.lstIdSelectedItems}" layout="pageDirection"> <f:selectItems value="#{backedBean.lstAvailableItems}" var="item" itemLabel="#{item.label}" itemValue="#{item.value}" /> <f:ajax listener="#{backedBean.itemClicked}" /> </h:selectManyCheckbox> </h:form> And the code of a session managed bean: public class BackedBean implements Serializable { private List<SelectItem> lstAvailableItems; private List<Long> lstIdSelectedItems; public BackedBean() { lstAvailableItems = new

Collection of selectManyCheckbox inside a ui:repeat knows which element of the repeater it belongs to

泪湿孤枕 提交于 2019-11-27 16:29:10
I am developing a web app using JSF 2. My web app among other things contains a series of questions put one at a time (so one question is visible at a time) and have multiple answers (I use h:selectManyCheckbox). I store the questions and possible answers in a ArrayList ("gridQuestionListClone") and the users answers (before checking them at the end) in a HashMap ("allQuestionUserAnswerMap"). (I could change the storage modality if the answer demands it). When the user finishes answering all the questions I want to give the user the possibility to recheck all the questions and answers (I want

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

LazyInitializationException in selectManyCheckbox on @ManyToMany(fetch=LAZY)

ⅰ亾dé卋堺 提交于 2019-11-27 15:09:01
What is the best way to handle multiple chackboxes when you nead to fill a JPA M:N relation ... for example I have an JPA entity Hardware and the entity Connectivity. Hardware has a set for connectivity : private Set<Connectivity> connectivities = new HashSet<Connectivity>(0); and has a setter and getter like this : @ManyToMany(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.REFRESH }, mappedBy = "hwProviders") public Set<Connectivity> getConnectivities() { return this.connectivities; } public void setConnectivities(Set<Connectivity> connectivities) { this.connectivities =

Collection of selectManyCheckbox inside a ui:repeat knows which element of the repeater it belongs to

限于喜欢 提交于 2019-11-26 22:27:29
问题 I am developing a web app using JSF 2. My web app among other things contains a series of questions put one at a time (so one question is visible at a time) and have multiple answers (I use h:selectManyCheckbox). I store the questions and possible answers in a ArrayList ("gridQuestionListClone") and the users answers (before checking them at the end) in a HashMap ("allQuestionUserAnswerMap"). (I could change the storage modality if the answer demands it). When the user finishes answering all

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

LazyInitializationException in selectManyCheckbox on @ManyToMany(fetch=LAZY)

戏子无情 提交于 2019-11-26 17:03:01
问题 What is the best way to handle multiple chackboxes when you nead to fill a JPA M:N relation ... for example I have an JPA entity Hardware and the entity Connectivity. Hardware has a set for connectivity : private Set<Connectivity> connectivities = new HashSet<Connectivity>(0); and has a setter and getter like this : @ManyToMany(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.REFRESH }, mappedBy = "hwProviders") public Set<Connectivity> getConnectivities() { return this

Use enum in h:selectManyCheckbox

自闭症网瘾萝莉.ら 提交于 2019-11-26 13:19:51
I want to use enum values in a <h:selectManyCheckbox> . The checkboxes get populated correctly, however, when selecting some values and submitting them, their runtime type is String , and not enum. My code: <h:selectManyCheckbox value="#{userController.roles}" layout="pageDirection"> <f:selectItems value="#{userController.rolesSelectMany}" /> </h:selectManyCheckbox> UserController class (SecurityRole is an enum type): public SelectItem[] getRolesSelectMany() { SelectItem[] items = new SelectItem[SecurityRole.values().length]; int i = 0; for (SecurityRole role : SecurityRole.values()) { items[i