selectonemenu

Clicking p:commandButton causes the value of p:selectOneMenu being set twice

故事扮演 提交于 2019-12-11 04:36:35
问题 I ran into an issue with PrimeFaces - consider form with SelectOneMenu being put inside of Inplace . Next to the Inplace we have a CommandButton that is meant to reset the value of the SelectOneMenu . The form looks like this: <h:form id="myform"> <p:inplace id="inplace" editor="true"> <p:ajax event="save" update="@(form)" /> <f:facet name="output"> <h:outputText value="#{testBean.year}" /> </f:facet> <f:facet name="input"> <p:selectOneMenu id="selYears" value="#{testBean.year}"> <f

Primefaces selectOneMenu converter called but not working

爱⌒轻易说出口 提交于 2019-12-11 03:02:42
问题 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 gets regenerated then all changes will be lost (The work around is to change toString of the entity class). The XHTML code snipped: <p:selectOneMenu id="defid" value="#{abcController.selected.defid}" converter="defConverter"> The

JSF Primefaces SelectOneMenu

。_饼干妹妹 提交于 2019-12-11 02:48:50
问题 Person can have only one car , but in the datatable I want to display all the cars in the list but select the one user person belongs to. This way user can update any person's car on the fly. Let say I have two tables Person id name car_id Cars id name Ideally , person should have Cars id as primary key but that is not the case. So each person has car ,right. Now I am displaying list of person in datatable e.g. ------------------------------------ Name | Car ----------------------------------

selectOneMenu shows after submit always the last item in the list as selected item

可紊 提交于 2019-12-11 02:15:15
问题 Info JSF 2.0 Primefaces 3.4 Both objects are People objects I have a simple drop down menu that is contained within a form that submits the selection on form submit (AJAX call): <h:form> .... <p:selectOneMenu converter="personconverter" value="#{searchperson.viewPerson.relatedTo}" filter="true" filterMatchMode="startsWith"> <f:selectItems value="#{searchperson.people}" var="person" itemLabel="#{person.fullName}" itemValue="#{person}" /> </p:selectOneMenu> .... <p:commandButton value="Save"

primefaces' selectOneMenu with converter not working with my backingBean

两盒软妹~` 提交于 2019-12-11 02:03:55
问题 I got a problem using selectOneMenu, it can clearly convert the Suppliers to SupplierBean (my boss use to call it that way-he was the one who set it up), and display it correctly on the page, but the moment i save it, it returns a null value. My code in XHTML: <p:selectOneMenu value="#{itemSupplierController.supplierBean}" converter="supplierConverter"> <f:selectItem itemLabel="Select..." itemValue="" /> <f:selectItems value="#{supplierController.suppliersBean}" var="s" itemValue="#{s}"

Primefaces Commandbutton not working after an update made by select box

泄露秘密 提交于 2019-12-11 01:54:17
问题 Iam having four select menus in my page. My problem is weird i.e. without selecting any of the dropdown menu if you click on submit, it is working fine. But when i select subgroup dropdown menu and later if i click the submit button it is not calling the method it intended to call... Heres my code.. <?xml version="1.0"?> <f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:p

PrimeFaces selectOneMenu not rendering Images and Strings

会有一股神秘感。 提交于 2019-12-10 12:08:05
问题 I'm using PrimeFaces selectOneMenu to display some images and strings next to them, i'm only concerned with the string next to the image, the image itself is for displaying only, i tried this but it didn't work: <p:selectOneMenu id="SkinChooser" value="#{personBean.skin}" panelStyle="width:150px" effect="fade" var="s" style="width:160px"> <f:selectItem itemLabel="Select One" itemValue="" /> <f:selectItems value="#{personBean.selectedSkins}" var="skin" itemLabel="#{skin.skinType}" itemValue="#

change selected item of selectonemenu primefaces by managedbean of javascript

落爺英雄遲暮 提交于 2019-12-09 18:36:06
问题 I want to change the selected value of this selectOneMenu either by managed bean or javascript: <p:selectOneMenu id="edit-article-famille" widgetVar="editFamille" required="true" requiredMessage="Veuillez choisir une famille" value="#{articlesMB.selectedFamille}"> <f:selectItem itemLabel="selectionner famille" itemValue=""/> <f:selectItems value="#{articlesMB.listFamilles}"/> </p:selectOneMenu> How can I do it? In the primefaces user guide, they don't talk about that. 回答1: You can set value

Facelet selectOneMenu with POJOs and converter problem

无人久伴 提交于 2019-12-08 08:17:59
问题 I want to have a facelet page with a formular and a dropdown menu. With the dropdown menu the user shoul select a POJO of the type Lieferant: public class Lieferant extends AbstractPersistentWarenwirtschaftsObject { private String firma; public Lieferant(WarenwirtschaftDatabaseLayer database, String firma) { this(database, null, firma); } public Lieferant(WarenwirtschaftDatabaseLayer database, Long primaryKey, String firma) { super(database, primaryKey); this.firma = firma; } public String

selectOneMenu with complex objects, is a converter necessary? [duplicate]

╄→гoц情女王★ 提交于 2019-12-08 03:01:26
This question already has answers here : Conversion Error setting value for 'null Converter' - Why do I need a Converter in JSF? (2 answers) Closed 4 years ago . Is a Converter necessary for a <h:selectOneMenu> or <p:selectOneMenu> with arbitrary user-created classes as its values? I mean, is the following code supposed to work without a converter? <p:selectOneMenu value="#{bean.language}"> <f:selectItems value="#{bean.allLanguages}" /> </p:selectOneMenu> and @Named(value = "bean") @ConversationScoped public class Bean { private Language language; // appropriate getter and setter are present