selectonemenu

How to disable the required tag on a selectOneMenu when p:ajax event=change?

青春壹個敷衍的年華 提交于 2019-12-12 09:43:43
问题 Here is my configuration: PrimeFaces: 4.0.4 (elite) OmniFaces: 1.6.3 JSF: MyFaces 2.0.2 Server: WebSphere 8.5.0.2 Some code (I only post the relevant part for better clarity): <p:selectOneMenu value="#{viewModel.selectedContact}" required="true" converter="omnifaces.SelectItemsConverter"> <p:ajax event="change" listener="#{viewModel.updateContact}" update="area"/> <f:selectItem itemValue="#{null}" itemLabel="#{msg.no_contact}" noSelectionOption="true" /> <f:selectItems value="#{viewModel

Retrieving the value of the selected item in a SelectOneMenu List

百般思念 提交于 2019-12-12 05:27:13
问题 i just want to retrieve the login of the selected User in the SelectOneMenu List here's the code : My xhtml page : <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui"> <h:head> <title>JSF

f:ajax not working when dropdown return null

笑着哭i 提交于 2019-12-12 04:49:33
问题 The dropdown is linked with converter. The ajax works when dropdown value is changed. But in case of selection of "-- Select --" item from dropdown, ajax does not invoke listener. I could not find any good solution. Code is given below. <h:selectOneMenu value="#{cc.attrs.beanProperty}" converter="myConverter" > <f:selectItem itemValue="#{null}" itemLabel="-- Select --" /> <f:selectItems value="#{cc.attrs.list}" var="item" itemValue="#{item}" itemLabel="#{item.name}" /> <f:ajax render=":form1"

Validation Error: Value is not valid

╄→гoц情女王★ 提交于 2019-12-12 03:37:25
问题 I have a problem with a p:selectOneMenu, no matter what I do I cannot get JSF to call the setter on the JPA entity. JSF validation fails with this message: form:location: Validation Error: Value is not valid I have this working on several other class of the same type (ie, join table classes) but cannot for the life of me get this one working. If anyone can throw some troubleshooting/debugging tips for this sort of problem it would be greatly appreciated. Using log statements I have verified

How to show null value in p:SelectOneMenu ONLY when said value is null in the backing bean?

浪尽此生 提交于 2019-12-12 02:09:30
问题 Here's my selectOneMenu: <h:form> <p:selectOneMenu id="handlerSelect" value="#{caseController.case.handler}" converter="omnifaces.SelectItemsIndexConverter" style="width:182px"> <f:selectItems value="#{handlerController.findAllHandlers()}" var="handlerSelect" itemLabel="#{handlerSelect.name}" itemValue="#{handlerSelect}" /> <p:ajax event="change"listener="#{caseController.changeHandler}" update="handlerSelect"/> </p:selectOneMenu> </h:form> The default value showing in this selectOneMenu as

Disabling items with PrimeFaces SelectOneMenu with custom content / p:column

一个人想着一个人 提交于 2019-12-12 00:08:00
问题 it seems as if it is not possible to disable items in a SelectOneMenu from PrimeFaces (3.3) when using the custom content (as shown at http://www.primefaces.org/showcase-labs/ui/selectOneMenu.jsf). The testcase is simple, just take the following: <h:form> <p:selectOneMenu value="#{testBean.selected}"> <f:selectItems value="#{testBean.options}" var="t" itemLabel="#{t.label}" itemValue="#{t}" itemDisabled="#{t.value % 2 == 0 ? 'true' : 'false'}" /> </p:selectOneMenu> <p:selectOneMenu value="#

h:graphicImage not reRender

故事扮演 提交于 2019-12-11 23:17:55
问题 i have a jsf file where i have selectOneMenu and a h:graphicImage.Now the problem is when i send onchange request through selectOneMenu and want to reRender the h:graphicImage and want to show and hide boolean in action bean.But not work properly. Actully first i investigate it very carefully that when i send action through selectOneMenu the boolean value set correctly in bean but not set the reRender value properly.If i refresh page then it work properly.Anyone who i can solve it if i want

Pick Custom Object from Select one menu JSF Converter Exception [duplicate]

空扰寡人 提交于 2019-12-11 15:44:26
问题 This question already has answers here : Pick Custom Object from Select one menu JSF [duplicate] (2 answers) Closed 6 years ago . i want to pick custom object from select one menu. it neither shows an error nor values. what to do? please help me. thanks in advance. Now i'm seeing Null pointer exception at getAsObject at this line: return getCurrencyService().getCurrencyBtId(currencyId); this is my xhtml document <h:panelGrid columns="2"> <p:outputLabel value="" /> <p:selectOneMenu id=

JSF f:selectItems set item selected [duplicate]

限于喜欢 提交于 2019-12-11 14:26:01
问题 This question already has answers here : Default selection for <f:selectItem> within <h:selectOneMenu> (3 answers) Closed 3 years ago . I have a <f:selectItems> as follows: <p:selectOneMenu id="anios"> <f:selectItems value="#{pruebaCalendarBean.anios}" var="anio" itemLabel="#{anio}" itemValue="#{anio}" /> </p:selectOneMenu> anios is defined as: String[] anios = new String[]{"2014","2015","2016","2017"}; The value selected is 2014, but I want that is 2016. How to do this? I'm using Primefaces.

How to display all enum values as <f:selectItems> with enum property as label

萝らか妹 提交于 2019-12-11 07:18:26
问题 I have a RoleStatus enum which is as being a property of Role entity mapped to an integer in the DB (but that part is irrelevant). I'd like to present a List<Role> in a <p:dataTable> in which one column should have a <h:selectOneMenu> for the RoleStatus property of the Role entity. How can I implement this with or without OmniFaces? Here's the enum: public enum RoleStatus { ACTIVE(1, "Active"), DISABLE(2, "Disable"); private final int intStatus; private final String status; private RoleStatus