jsf-2

Can't access javascript file in jsf component

二次信任 提交于 2019-12-23 16:43:21
问题 I have a jsf component that must access to a javascript file, i added this whith outputScript as in the code bellow, I get an error in the generated html, and the javascript can't be reached. The javascript file is located in document_root/js directory How can i resolve this problem, thank you for your help. <!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

primefaces autocomplete event itemSelect listener value null in ManagedBean

依然范特西╮ 提交于 2019-12-23 16:27:27
问题 I am using Primefaces 3.4.2 Autocomplete. In ManagedBean when I select a row as I type characters in autocomplete, I am not able to get the value in method handleSelect(SelectEvent event) { What could be the reason for this? Ideally I would like to fill or populate other columns in jsf page when I select a row from autocomplete values. JSF code for autocomplete <p:autoComplete value="#{empMB.selectedEmployee}" id="basicPojo" minQueryLength="3" completeMethod="#{myMB.complete}" var="p"

Practical implications of Facelets ui:remove tag

核能气质少年 提交于 2019-12-23 16:27:07
问题 I want to understand the basic mechanism of <ui:remove> . As per my knowledge, <ui:remove> is basically used in conjunction when basic HTML stuff is part of your Facelets page. When you want, when rendering of the Facelets page happen, it should ignore this part of HTML code, we can use the <ui:remove> tag. Still I am confused about practical implications of <ui:remove> . How often we need to use this Facelets tag? Additionally, the Facelets page is not compiled everytime when the page is hit

JSF2.1.7 renders <!--[if IE ]> tag as text

荒凉一梦 提交于 2019-12-23 16:08:40
问题 We upgraded our JSF to latest version 2.1. previously we were in JSF2.0.4. Our xhtml pages has Targeting IE Using Conditional Comments tag,which were not rendered as text. But with new JSF2.1.7 this is being rendered as text in IE . Any ideas how to get around this issue? 回答1: Use <h:outputText escape="false"> instead. <h:outputText value="<!--[if IE]><link rel="stylesheet" type="text/css" href="ie.css"/><![endif]-->" escape="false" /> 回答2: You can do something like this: <f:verbatim> <!--[if

Automatically copy inputText maxlength from entity class @Size value

不问归期 提交于 2019-12-23 16:01:42
问题 Is it possible to set the maxlength attribute of an <h:inputText> tag to be the same as its entity class @Size max value? For example, given: @Size(max = 50) String name; ...somehow automatically/programmatically set the number 50 in: <h:inputText id="name" maxlength="50" .../> 回答1: This can be done using Apache MyFaces Extensions Validator, ExtVal. This link and this link explain how to add ExtVal into your project. You need to add the required jars and to add the annotation @MaxLength above

JSF Converter Timestamp

若如初见. 提交于 2019-12-23 15:29:59
问题 I want to convert my input into a timestamp value. I have only found a dateconverter in examples. Are there any best practises? Thank you Update: I want to save a birthday of a user but my backend requires a timestamp value. And I have problems with binding it to my jsf frontend.. Maybe a link to an example would be helful :-) I tried it as follows: public void setBday(Date bday) { member.setBirthday(new Timestamp(bday.getTime())); } public Timestamp getBday() { return member.getBirthday(); }

Managed property inheritance

折月煮酒 提交于 2019-12-23 15:26:07
问题 My problem is similar to this issue. I have a BaseBean which currently has just a single property which is annotated as a @ManagedProperty . However, when I access the getter of this inherited managed property in the action method a commandbutton, it returns null. I debugged and confirmed that the base bean constructr was called twice - once on page load and next on click of the button as already described in the mentioned link. I followed the suggestions as mentioned the article's chosen

Difference between Application Scope in JSF and Singleton Scope in Spring

ⅰ亾dé卋堺 提交于 2019-12-23 15:18:16
问题 Can anyone shade some light on the difference between ApplicationScope(JSF) and Singleton(Spring MVC). I have a application written in jsf in which one of the class uses application scope. And while converting to spring I used Singleton scope which I believe slightly equivalent to Application scope. But want to dig in deep to know what actually varies between both in areas such as performance etc. 回答1: Both are similar in the sense that, once started they will live on until the application

Primefaces datatable with column toggler conflicts with sort function on column

故事扮演 提交于 2019-12-23 15:08:05
问题 I have a data table that has a column toggler. When I uncheck a column and sort on a field the table is wrong. The header of the unchecked field pops back up and all data shift to the left, which leaves 1 column empty. My table.xhtml file: <h:form> <p:dataTable id="registrations" var="registration" tableStyle="table-layout: auto;" widgetVar="registrationsTable" value="#{overviewBean.listOfRegistrations}" filteredValue="#{overviewBean.filteredListOfRegistrations}" emptyMessage="No

Primefaces datatable with column toggler conflicts with sort function on column

拈花ヽ惹草 提交于 2019-12-23 15:06:04
问题 I have a data table that has a column toggler. When I uncheck a column and sort on a field the table is wrong. The header of the unchecked field pops back up and all data shift to the left, which leaves 1 column empty. My table.xhtml file: <h:form> <p:dataTable id="registrations" var="registration" tableStyle="table-layout: auto;" widgetVar="registrationsTable" value="#{overviewBean.listOfRegistrations}" filteredValue="#{overviewBean.filteredListOfRegistrations}" emptyMessage="No