jsf-2

Why is @FacesConverter(forClass=String.class) not working

我只是一个虾纸丫 提交于 2019-12-11 12:07:57
问题 I followed the example here: Why does <h:inputText required="true"> allow blank spaces? to create a "Global" converter to trim all input fields. However, the converter is not being invoked when input fields are submitted. @FacesConverter(forClass=String.class) ... <p:inputText value="#{controller.inputValue}"/> but when I change to: @FacesConverter("StringTrimmer") ... <p:inputText value="#{controller.inputValue}" converter="StringTrimmer"/> it works. Using Mojarra 2.1.7 and PrimeFaces 3.2

JSF / Mojarra 2.0.2: ui:repeat is totally broken when updating via AJAX

核能气质少年 提交于 2019-12-11 12:07:51
问题 Using ui:repeat for simple listing of elements produces very strange results - when you add an element, the first element is always replaced with the values from the last element before the submit. Same occurs when removing the elements - the first element shows actually the just removed element. With h:dataTable the same works perfectly. Running Mojarra 2.0.2. 回答1: This is probably because bug in Mojarra 2.0.2. At least in this case, updating to Mojarra 2.0.3 resolves the issue. However, the

Duplicated mapping id with PrettyFaces

拟墨画扇 提交于 2019-12-11 12:03:55
问题 i am using PrettyFaces 3.3.0 with Spring Security 3 i have two beans UserBean which is mapped to serve to pages (users,add) and LoginBean to serve the login page my mappings is as follows: 1- UserBean: @Component("user") @Scope("request") @URLMappings(mappings = { @URLMapping(id = "users", pattern = "/users", viewId = "/faces/users.xhtml"), @URLMapping(id = "add", pattern = "/add", viewId = "/faces/add.xhtml") }) public class UserBean { 2- LoginBean: @Component("login") @Scope("request")

How change icon Marker Gmap Primefaces?

夙愿已清 提交于 2019-12-11 11:57:21
问题 Hello community I'm starting with Gmap Primefaces component, and want to know how to change the icons. I have relied on the showcase of Primefaces: this.advancedModel.addOverlay(new Marker(coord1, "Konyaalti", "konyaalti.png", "http://maps.google.com/mapfiles/ms/micons/blue-dot.png")); this.advancedModel.addOverlay(new Marker(coord2, "Ataturk Parki", "ataturkparki.png")); this.advancedModel.addOverlay(new Marker(coord4, "Kaleici", "kaleici.png", "http://maps.google.com/mapfiles/ms/micons/pink

JavaServer Faces 2.2 composite component rendered with enclosing <html> … </html> tags

僤鯓⒐⒋嵵緔 提交于 2019-12-11 11:52:27
问题 While migrating a project from JavaServer Faces 2.1 / Java EE 5 to JavaServer Faces 2.2 / Java EE 7 web profile on GlassFish 4, I encountered invalid HTML code because of additional <html> ... </html> tags for every instance of a composite component in the JSF code. Environment: Mojarra 2.2.0 (GlassFish 4.0), NetBeans 7.3.1, JDK 7 Steps to reproduce: create a new "Java EE 7 Web" project with JavaServer Faces and choose JSF 2.2 server library in index.html, select the HTML body text ("Hello

Disable User Selection in <h:selectOneRadio>

限于喜欢 提交于 2019-12-11 11:47:13
问题 I am trying to disable user selection in tag. <h:selectOneRadio id="wildcard" value="#{NewService.isWildCard}" label="#{msg.org_IsWildCard}" readonly="true" layout="lineDirection"> <f:selectItem id="yes" itemLabel="YES" itemValue="1" /> <f:selectItem id="no" itemLabel="NO" itemValue="0" /> </h:selectOneRadio> However on my GUI I am still able to select radio button value. Please tell me what is wrong in the code..Also the BackingBean code is pretty simple..I am just passing 0 or 1 in

java ee - JSF 2.0 ViewScoped Bean after redirect to new window NPE

谁说胖子不能爱 提交于 2019-12-11 11:43:48
问题 I use tip from this post https://stackoverflow.com/a/13838907 to open new tab, however when I go back to old one I get nullPointerException and my ViewScoped bean data are lost. <h:form target="_blank"> <p:commandButton value="open new tab" action="#{otherBean.newTab}" ajax="false" /> </h:form> <h:form> <p:commandButton value="this wll cause NPE" action="#{pageBean.action}"/> </h:form> Click first button, go back to previous tab, click second button. PageBean is created once again and all

Javascript in JSF - outputScript with no library, no name, and no body content

十年热恋 提交于 2019-12-11 11:33:57
问题 I want to implement a pacman game in an jsf/primefaces project. The game can be found here. Here is my jsf page: <!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:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui"> <h:head> <title>Screen</title> <meta http-equiv="Content-Type

c:foreach returns only one empty value

帅比萌擦擦* 提交于 2019-12-11 11:32:13
问题 I'm using JSF 2 and I need c:foreach in some purposes. But no matter how big my list is, c:foreach loops only once, returning empty value. I tried everything, I even isolated c:foreach in separate .xhtml, but it still gives same result. If you need some piece of code, please ask, but I would like to make c:foreach work at least in separate .xhtml, and I supose that than it will work in my code, too. 回答1: Open the page in the webbrowser, rightclick and View Source . You see the <c:forEach> tag

how to use jquery datepicker in jsf

若如初见. 提交于 2019-12-11 11:29:33
问题 I want to use the jquery datepicker: http://jqueryui.com/datepicker/ But I don't know what I need, and here is my code: <script src="css/jquery-1.9.1.js"></script> <script src="css/jquery.ui.core.js"></script> <script src="css/jquery.ui.widget.js"></script> <script src="css/jquery.ui.datepicker.js"></script> <script type="text/javascript"> $(".datepicker").datepicker({ showOn: "button", buttonImage: "images/calendar.gif", buttonImageOnly: true }); The place I put my datepick is like: <h