FAQ Database Discussion Community


Show String JSF [duplicate]

list,jsf,selectonemenu
This question already has an answer here: How to prepopulate <h:selectOneMenu> with entities from database? 3 answers I want to show in a list the names of the buildings have stored in the database, using h: selectOneMenu f: SelectItems. Part of .xhtml where I do this is: <h:form id="form-lista">...

Conversion Error setting value '1' for 'null Converter' [duplicate]

jsf,selectonemenu
This question already has an answer here: How to prepopulate <h:selectOneMenu> with entities from database? 3 answers When I click submit button in a jsf page I get the above error. html: <h:selectOneMenu id="ddlCountryCode" value="#{jsfFills.countries}"> <f:selectItems value="#{jsfFills.countries}" var="c" itemLabel="#{c.CName}" itemValue="#{c.CCode}" /> </h:selectOneMenu> ...

How to get value from Map in item label

jsf,dictionary,jsf-2,selectonemenu
Below is the jsf code <h:selectOneMenu> <f:selectItems value="#{bean.mapObject}"var="entity" itemValue="#{entity.key}" itemLabel="#{entity.value.code}"/> </h:selectOneMenu> Backing bean has map defined as private Map<TestClass, Object> mapObject; TestClass has two variables and getters/setters String code; String name; Issue I am having is : On JSF, on Selectonemenu, for itemLabel i would like to display the TestClass...

how to use selectOneMenu with object in selectItems

java,composite,selectonemenu
I don`t understand how to use ArrayList of objects in f:selectitems. I use composite components and code below is not work: <h:selectOneMenu id="kladrRegion-dctKladrRegion" tabindex="100" value="#{cc.attrs.kladrRegion}" styleClass="comboBox ui-corner-all inputText ui-inputfield kladrSearchFormInput kladrSearchFormSelectWidth selectHight" style="font-size: 13px; width: 300px;" binding="#{cc.attrs.cbKladrRegion}" > <f:selectItems value="#{cc.attrs.kladrRegions}" var="region" itemLabel="#{region.value}" itemValue="#{region.id}"...

Get label of when using on Map

jsf,primefaces,label,selectonemenu
I am trying to get the label of <p:selectOneMenu> when using <f:selectItems> on a Map. View: <p:selectOneMenu id="console" value="#{formBean.userRegion}" style="width:125px"> <f:selectItems value="#{formBean.region.regions}"></f:selectItems> </p:selectOneMenu> Bean: @Inject private Region region; //where region.getRegions() is LinkedHashMap public void regionChanged(AjaxBehaviorEvent e) { //it prints map element value but I need element name System.out.println("userRegion= " +...

Primefaces selectOneMenu update outputLabel and inputText

jsf-2,primefaces,selectonemenu
I've googled and stackoverflowed a lot but I can't seem to find the answer. What needs to be done is that the outputLabel's value needs to be updated when the selection change, also inputText's disabled needs to change to enabled when you select option B. (Furthermore; the selected value is...

confirmDialog is not taken the new value of the selectOneMenu

primefaces,selectonemenu
I need to change the status in database but when I change the status the confirmDialog is not taking the new value, it gets the old one <p:selectOneMenu converter="omnifaces.SelectItemsConverter" disabled="#{myBB.currentStatus != StatusEnum.TEMP}" id="statusSOM" onchange="PF('confirm').show();" value="#{myBB.currentStatus}" widgetVar="statusWV"> <f:selectItems itemDisabled="#{status == StatusEnum.ALL}" itemLabel="#{msgs[status.name]}" itemValue="#{status}" value="#{myBB.statusList}" var="status" /> </p:selectOneMenu>...

Primefaces selectOneMenu converter called but not working

java,jsf-2,primefaces,converter,selectonemenu
I've looked at the other questions this and this, etc, the problem is that my convert gets called but the values of selectOneMenu doesn't change. My entity class is generated, and has equals as well as hashCode and I would like not to change anything in it - if it...

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

jsf,jsf-2,primefaces,selectonemenu,selectmanymenu
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...

Get p:dataTable row data via p:selectOneMenu

jsf-2,primefaces,datatable,row,selectonemenu
I have a dataTable which one of the columns contains a selectOneMenu (a.k.a dropDownList). Basically each row has a selectOneMenu which has a list of values. Is there a posibility to pass the row data or key whenever the selectOneMenu value has been selected? This way I can loop through...

selectonemenu defualt value does not work in table row editor

jsf,primefaces,selectonemenu
I have a p:selectOneMenu tag in a p:cellEditor tag of a table with roweditor. here is it's code: <p:column headerText="Update Interval"> <p:cellEditor> <f:facet name="output"><h:outputText value="#{news.intervalLabel}"/></f:facet> <f:facet name="input"> <p:selectOneMenu value="#{newsManagementBean.intervals}" valueChangeListener="#{newsManagementBean.changedIntervals}" style="width: 200px;"> <f:selectItems value="#{newsManagementBean.updateIntervals}" var="interval"...