jsf-2

PrimeFaces + DataTable(edit row) + Hibernate+ MYSQLDatabase

微笑、不失礼 提交于 2019-12-12 02:04:10
问题 I would like to edit datatable row. My code here my ManagedBean @ManagedBean @ViewScoped public class course implements Serializable{ private int course_Id ; private String course_Name; private Integer course_Hours ; private Date course_Date; private Double course_Prise ; SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy"); private String sd ; getter and setter ..... public void onRowEdit(RowEditEvent event) { course c =((course) event.getObject()); Transaction trn = null ;

Dynamic view id using pretty faces navigation refuses to work

陌路散爱 提交于 2019-12-12 02:03:57
问题 I am attempting to migrate an application from JSF 1.2 to JSF 2.1. The code below worked in the 1.2. I am using PrettyFaces 3.3.3, MyFaces 2.1. in pretty-config.xml: <url-mapping id="seSite"> <pattern value="/sites/#{seViewChooserBean.urlSiteType}/#{seViewChooserBean.siteId}"/> <view-id value="#{seViewChooserBean.getSiteViewId}"/> </url-mapping> <url-mapping id="seSiteProps"> <pattern value="/sites/#{sePropsBean.urlSiteType}/#{sePropsBean.siteId}/properties"/> <view-id value="/pages/se/site

faces-config with from-outcome not being string (boolean) fails with NullPointerException

时光毁灭记忆、已成空白 提交于 2019-12-12 02:03:13
问题 I've been using JSF 2.1 with mojarra-2.1.20 , and I've configured in my faces-config.xml a navigation case like this: <navigation-rule> <from-view-id>/loggedOut.xhtml</from-view-id> <navigation-case> <from-action>#{sessionManager.isLoggedIn}</from-action> <from-outcome>true</from-outcome> <to-view-id>/login.xhtml</to-view-id> <redirect /> </navigation-case> </navigation-rule> The action is executed using seam-faces viewAction (similiar to JSF 2.2 new tag). All has been working fine. Today I

JSF and background image in CSS folder, without '#{resource}' reference

柔情痞子 提交于 2019-12-12 01:52:50
问题 In a JSF2, i'm trying as this say, to put a background image inside the css folder to avoid the #{resource} reference, being the last option from BalusC : Much better , however, is to store the CSS-included images in the CSS folder, so that you don't need to fiddle with #{resource} in the CSS. But when following his instructions, the stylesheet link is built as <link type="text/css" rel="stylesheet" href="/webapp/javax.faces.resource/css/stylesheet.css.xhtml"> and the content from the CSS,

Primefaces lightBox closes at click on commandLink

倖福魔咒の 提交于 2019-12-12 01:45:32
问题 It's just a simple Primefaces lightBox I want to use commandLinks in. Unfortunately it simply closes, when I click a commandLink. Is there a way to keep the lightBox open? Here an example of what my code looks like: <ui:composition 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" template="template.xhtml"> <ui:define name="content"> <p:lightBox> <h

Running open layer with JSF and .xhtml file

主宰稳场 提交于 2019-12-12 01:44:52
问题 I made a jsf project and have the following example from http://docs.openlayers.org/library/introduction.html but as a xhtml file this wouldn't run and as a html file it would run. How to run it with jsf and .xhtml. It runs with html though. <?xml version="1.0" encoding="UTF-8"?> <!-- To change this template, choose Tools | Templates and open the template in the editor. --> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"> <h:head> <script src=

Setting value of a h:selectOneMenu from a for each

泪湿孤枕 提交于 2019-12-12 01:42:55
问题 This is the for each to iterate a list of products and I need to set the productGroupId in the drop down below. <c:forEach items="${productgroup.productList}" var="product"> <h:selectOneMenu value="${product.appleProdgroupId}"> <f:selectItems value="#{displayProductsBean.productGroupListDropDown}"/> </h:selectOneMenu> I have tried all combination but it is not working ...can anyone please help 回答1: It's unclear what exactly you mean with "It is not working". In the code posted so far I see at

Organizing .xhtml files in subfolders

拈花ヽ惹草 提交于 2019-12-12 01:37:29
问题 I have a JSF 2.0 project wiht lots of .xhtml files. Due to a security filter I want to put some of the files in a /secure folder to then aply the filter on. I tried simply moving the files to a folder. But then I get an exception "/selectRole.xhtml Not Found in ExternalContext as a Resource" Do I need to add something to the faces-config or web.xml? 回答1: Your application is trying to read /selectRole.xhtml from a bean, or redirect action. In JSF2, the navigation rules are written in the beans

JSF 2.1 SelectOneMenu toggling automatically to init values

亡梦爱人 提交于 2019-12-12 01:35:02
问题 I have 2 SelectOneMenu as follows in the index.xhtml. The menu1 essentially chooses a language(sp or en) and menu2 displays the possible serial numbers(0 to 3). I have the init constructor(post constructor) which initialises the default values on the two Menus. However for some strange reason, if I select a serial number other than the default serial number for the language other than the default language, somehow the language gets reset to init default :( <?xml version='1.0' encoding='UTF-8'

How save or update single inputText field using ajax listener

浪子不回头ぞ 提交于 2019-12-12 01:29:34
问题 I spent already more time as is good about some saving or updating issue in inputtext field, i go right to the point: i have basic single input text with some basic attributtes <h:inputText id="name" value="#{salesController.selectedSalesName}" /> here is a getter for inputText value public String getSelectedSalesName(){ for(DealerListView dealer : dealerList){ if(dealer.getDealerId() == getSelectedDealerId()){ return dealer.getName(); } } return ""; } nested in there i use ajax tag <f:ajax