jsf

Immediate attribute for UIInput component

我怕爱的太早我们不能终老 提交于 2020-01-24 20:48:07
问题 HI, If I am adding the immediate attribute true for the UIInput component and UICommand button doesn't have the immediate attribute. What will be the flow? Please answer my below questions. If that UIInput has the invalid data, will the error shown in the screen. If there is another UIInput component with immediate attribute, if this also has the invalid data, will the error shown in the screen. I know that the validation will happen in the Apply Request values phase. Does the only validation

How to populate a dropdown on page load in jsf? [duplicate]

删除回忆录丶 提交于 2020-01-24 20:30:08
问题 This question already has answers here : How to populate options of h:selectOneMenu from database? (5 answers) Closed 3 years ago . I'm new to JSF, I read the JSF life cycle but couldn't understand how to achieve this? I've a controller say "Cities" and other controller "Countries". Now I'm going to create a new page, where I will provide search functionality. I showed two dropdowns on that page (One for countries and other for cities), I want the first drop down to be populated on page load.

How to reference an img in p:graphicImage from the resource folder [duplicate]

喜夏-厌秋 提交于 2020-01-24 12:17:21
问题 This question already has answers here : How to reference CSS / JS / image resource in Facelets template? (4 answers) Closed 3 years ago . I have an image in the following path: resources \_____img \_______sites \_______reddit.png I used this command line to reference it: <p:graphicImage library="img" name="/sites/reddit.png"/> but in the development console it says: GET http://localhost:8080/RES_NOT_FOUND 404 () and the image is not rendered. What's wrong? 回答1: Kukeltje's suggested url (What

Using JSF Converter in h:selectOneMenu results in Validation Error: Value not valid [duplicate]

倖福魔咒の 提交于 2020-01-24 10:38:25
问题 This question already has answers here : Validation Error: Value is not valid (3 answers) Closed 4 years ago . I have this SelectOneMenu: <h:selectOneMenu value="#{orderController.requestVO.requestSituation}"> <f:converter converterId="ComboConverter"/> <f:selectItems value="#{orderController.requestSituation}" var="requestSituation" itemLabel="#{requestSituation.description}" itemValue="#{requestSituation}" /> </h:selectOneMenu> The requestSituation is a ArrayList filled with

JBoss Seam: components injected into POJOs, but not Session Beans

本小妞迷上赌 提交于 2020-01-24 10:14:10
问题 I have a Seam component that handles login, with the name "authenticator": @Name("authenticator") public class AuthenticatorAction implements Authenticator { @PersistenceContext private EntityManager em; @In(required=false) @Out(required=false, scope = SESSION) private User user; public boolean authenticate(){ ... } } This works just fine, Seam injects the EntityManager instance. However, as soon as I add the @Stateless annotation, none of the injection happens! In this case, the

Generate CSS from JSF managed bean

佐手、 提交于 2020-01-24 09:50:06
问题 I have this CSS code: td[data-date='2016-03-08']{ background-color: #F7F7F7; } I want to apply it on several dates that I want to load from a database. All this could happen inside my JSF managed bean where I generate the CSS code. So my question is, how can I apply the CSS that I'm gonna get from my JSF managed bean? 回答1: One way is to print it as body of HTML <style> tag which you put in HTML head. <h:head> ... <style>#{bean.css}</style> </h:head> 来源: https://stackoverflow.com/questions

JSF set default value Radio Button h:selectOneRadio [closed]

心已入冬 提交于 2020-01-24 09:06:31
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . <h:selectOneRadio id="radio1" value="#{testBean.value}"> <f:selectItem itemValue="High School" itemLabel="High School" /> <f:selectItem itemValue="Bachelor's" itemLabel="Bachelor's"/> <f:selectItem itemValue=

Java infering wrong type of a typed HashSet [duplicate]

好久不见. 提交于 2020-01-24 05:23:50
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: ClassCastException when calling TreeSet<Long>.contains( Long.valueOf( someLongValue ) ) Please see the screenshot for the problem: It seems an entry in the Typed Set cylinderIds is suddenly of type String - but how did that happen? The bean is used from within a JSF page, but I always thought that the type system in Java should prevent this ... Any idea what is going wrong here? Using 1.7.0_06 64 Bit on Windows

Java infering wrong type of a typed HashSet [duplicate]

谁都会走 提交于 2020-01-24 05:23:05
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: ClassCastException when calling TreeSet<Long>.contains( Long.valueOf( someLongValue ) ) Please see the screenshot for the problem: It seems an entry in the Typed Set cylinderIds is suddenly of type String - but how did that happen? The bean is used from within a JSF page, but I always thought that the type system in Java should prevent this ... Any idea what is going wrong here? Using 1.7.0_06 64 Bit on Windows

“for” cycle in JSF

青春壹個敷衍的年華 提交于 2020-01-24 02:53:05
问题 I simply need to perform a very basic for cycle in JSF/ICEFaces, basically rendering column numbers Something like the following pseudo-code for(int i=0; i<max; i++) { <td>#{i}</td> } the <c:forEach> tag iterates over collections, but I don't want to make my backing bean more complex returning a stupid collection of integers. Do you know a shorter and smarter way? Thank you 回答1: The <ui:repeat> tag is what you should really use. The JSTL tags operate outside of the JSF Lifecycle. Cay Horstman