jsf-2

Why can I not get the submitted value from component binding?

邮差的信 提交于 2019-12-13 16:40:11
问题 In register.xhtml page, I have 2 inputText components for password and confirm password as following: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.prime.com.tr/ui" xmlns:f="http://java.sun.com/jsf/core"> <h:form> <h:outputText style="font-weight: bold" value="Password: " /> <p:password feedback="true" minLength="9" binding="#{mrBean.passwordComponent}" id="password" value="#{mrBean

ExtendedDataTable in RichFaces 4: DataModel handling

不想你离开。 提交于 2019-12-13 16:30:59
问题 I have another question, somewhat related to the one I posted in January. I have a list, which is rich:extendedDataTable component, and it gets updated on the fly, as the user types his search criteria in a separate text box (i.e. the user types in the first 4 characters and as he keeps typing, the results list changes). And in the end it works fine, when I use RichFaces 3, but as I upgraded to RichFaces 4, I've got all sorts of compilation problems. The following classes are no longer

Getting ERROR -java.lang.NoClassDefFoundError: javax/faces/component/behavior/ClientBehaviorHolder

故事扮演 提交于 2019-12-13 15:42:24
问题 I am getting following weird error while integrating SWF,Primefaces 2.2.1,JSF 2,Spring Security 3,Spring 3.1.0 INFO: Unsanitized stacktrace from failed start... com.sun.faces.config.ConfigurationException: Source Document: jar:file:/E:/30May2011/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/simpleWeb/WEB-INF/lib/primefaces-2.2.1.jar!/META-INF/faces-config.xml Cause: Class 'org.primefaces.component.autocomplete.AutoCompleteRenderer' is missing a runtime dependency: java.lang

JSF 2.2 SelectManyCheck breaks javascript

…衆ロ難τιáo~ 提交于 2019-12-13 15:12:41
问题 It used to work perfect on jsf 2.0 but know it renders a box at the end of the screen, with a html table with the data about locations, if I remove the converter the selectmany checkbox works but it still renders the box. <ui:composition template="/template.xhtml"> <ui:define name="title"> <h:outputText value="#{bundle.CreateOfertaTitle}"></h:outputText> </ui:define> <ui:define name="body"> <style type="text/css"> input#chat { width: 410px } #console-container { width: 400px; } #console {

Can I use EJB Stateless Bean with CDI to maintain user session?

强颜欢笑 提交于 2019-12-13 15:12:00
问题 Based on this post http://www.adam-bien.com/roller/abien/entry/ejb_3_1_killed_the I use in my app @Named @Stateless bean for communication with a database (injecting EntityManager here) and display information on a jsf page. It's great facilitation since Java EE 5, but I have one question. Is it secure to use such beans for maintaining a user session (shopping cart etc)? I read a book about ejb 3.0 and I know that the same stateless bean could be used with many clients. What's the best

JSF resets fields when doing an ajax update

孤者浪人 提交于 2019-12-13 14:51:27
问题 I have a problem on my JSF page where I type a name into the first billing first name field. If I click on copy billing address checkbox; this stops rendering the delivery address panel and hides it via ajax, the value I just typed into the first field gets reset to its previous state. JSF Page <h:form> <p:inputText value="#{addressBean.billingAddress.firstName}" required="true"/ > <p:selectBooleanCheckbox value="#{addressBean.copyBillingAddress}" id="duplicateBillingDetails"> <f:ajax render=

Validate email format and uniqueness against DB

无人久伴 提交于 2019-12-13 14:14:37
问题 I am creating a JSF form where I have an email field. I need to validate the email format and check for uniqueness against DB. I need to check this when the enduser has entered the email field. If it's present in the DB, then we need to change the field color to red and otherwise to green. I would like to perform this by ajax. I have seen examples in PHP, but it's not clear to me how to do it in JSF. 回答1: For general email format validation, you could use <f:validateRegex>. <h:inputText id=

Can I call methods on beans in composite components?

天大地大妈咪最大 提交于 2019-12-13 14:05:22
问题 I want to write a more or less gemeric component, where i hand in a controller bean and the componend should display some CRUD buttons. Following composite component: <composite:interface> <composite:attribute name="controller" /> <composite:attribute name="object" /> </composite:interface> <composite:implementation> <h:panelGrid columns="3" columnClasses="celltop"> <h:commandButton id="save" value="#{msg.saveButtonLabel}" action="#{cc.attrs.controller.save}" /> <h:commandButton id="delete"

Send a PDF to browser via JSF

China☆狼群 提交于 2019-12-13 13:59:35
问题 I am trying to send a JasperReports generated PDF file to user's browser, I can't find what's wrong in my managed bean method, here's a snippet: System.out.println("Making pdf..."); FacesContext fc = FacesContext.getCurrentInstance(); ExternalContext ec = fc.getExternalContext(); String tplPath = ec.getRealPath("testTemplate.jrxml"); JasperReport jasperReport = JasperCompileManager.compileReport(tplPath); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, new HashMap<String

Jsf composite components attribute doesn't work

浪尽此生 提交于 2019-12-13 13:43:15
问题 I am trying to create composite components. I defined 4 attributes in composite:interface section. Here is code <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core" xmlns:composite="http://java.sun.com/jsf/composite"> <composite:interface > <composite:attribute name="id" /> <composite:attribute name="maxlength" /> <composite:attribute name=