jsf-2

JSF 2.0 - selectOneMenu defaults to 0 when empty

风格不统一 提交于 2019-12-21 05:56:29
问题 For my project i want to implement a combobox with h:selectOneMenu . I read many posts about how to handle the selectOneMenu properly and how to implement a custom converter. The combobox shall store the ID ( Long ) from a different DB Table (named fk_ID) for which a constrain is in place. So far everything seems to function as planned. Now to my problem: The column fk_ID is optional, so the first option in the combobox is a f:selectItem with no value labeled "choose ...". When I save the

JSF 2.0 pass data between beans (or pages?)

拥有回忆 提交于 2019-12-21 05:11:21
问题 I'm working with JSF 2.0 I have a form in my admin section where I am going to select some users in a list. The form (selectusers.xhtml) is adding these users to a list in a bean (SelectUsers.java). After I have selected some user(s), I will pass the list of the user(s) from SelectUsers.java to another bean (AddAddressBean.java) and continue add information in another form (addadress.xhtml) which set other properties related to AddAddressBean for each user. I do not know how to implement it.

Error messages on page with the <h:messages> in JSF

人盡茶涼 提交于 2019-12-21 04:57:34
问题 I'm creating simple example on JSF. It's small Login application. My problem is duplicate error messages on my page: I have two h:message (for username and password) tags and one h:messages (global messages) on my page: <h:form id="loginForm"> <h:panelGrid columns="3"> <h:outputText value="Username" /> <h:inputText id="username" value="#{loginBean.username}" required="true" requiredMessage="Please enter your username" /> <h:message for="username" errorClass="errorMessage" /> <!-- Message for

selectonemenu inside table in jsf2

梦想的初衷 提交于 2019-12-21 04:57:23
问题 I have a table with 2 selectOneMenu components. I would like that once a record was chosen in the first selectOneMenu component it will update the other selectOneMenu with Ajax in the same row. My table: <p:dataTable value="#{myBean.myInfo}" var="myInfo"> <p:column> <f:facet name="header">Group</f:facet> <h:selectOneMenu value="#{myInfo.myInfoType.code}"> <f:selectItems value="#{myBean.myList}" /> <f:ajax event="change" execute="@this" listener="#{myBean.refershNames}" render="myNames"/> </h

How to rerender part of page with form in JSF 2.0?

喜夏-厌秋 提交于 2019-12-21 04:50:43
问题 Currently we're trying to move to JSF 2.0 from JSF 1.2 and one of the problem we've faced is that it's impossible to rerender part of the page that contains form. Like this (rerender outerDiv or forms themselves): <h:panelGroup id="outerDiv"> <h:form id="form1">...</h:form> <h:form id="form2">...</h:form> </h:panelGroup> I mean that if i update outerDiv everything is updated but the form (or forms) itself becomes broken and behaves strangely, at least ajax calls either don't work when first

JSF composite components in JAR not recognised in NetBeans

冷暖自知 提交于 2019-12-21 04:24:11
问题 I have added a common JAR to my project. The jar looks something like... CommonWeb.jar |-- META-INF | |-- resources | | `-- common | | |-- css | | | `-- my.css | | |-- js | | | `-- my.js | | |-- images | | | `-- my.png | | |-- components | | | `-- mycomposite.xhtml | | `-- templates | | `-- mytemplate.xhtml | |-- faces-config.xml | `-- MANIFEST.MF : Everything is working except that Netbeans will not recognise my composite component. The page trying to use the component looks something like

p:commandButton rendered property not working after ajax update (Primefaces 3.5)

扶醉桌前 提交于 2019-12-21 03:58:43
问题 I reviewed my code lot of times and didnt find questions about it. I have a problem with p:commandButton rendered property. The p:commandButton is allways displayed even if the getter method returns false. That happens after an ajax update. I have a p:selectOneMenu with a p:ajax event="change" that sets a MB and updates a p:commandButton (with a rendered property based on a boolean getter) and two other components: a second p:selectOneMenu and a p:outputLabel. The second p:selectOneMenu and

how to invalidate session in jsf 2.0 if browser get closed without being invalidating the current session.

我们两清 提交于 2019-12-21 03:18:30
问题 if i close my browser without invalidating the session then i don't want it to access my application without being log-in again. and don't want my user to get assess to the restricted user pages by using back button. how can i do this in JSF 2.0? 回答1: how to invalidate session in jsf 2.0 if browser get closed without being invalidating the current session. You can't do this programmatically in a reliable manner. The session will however automatically expire after 30 minutes. If you open a new

JSF 2.x + Spring 3.2 Integration?

被刻印的时光 ゝ 提交于 2019-12-21 02:56:08
问题 Sorry to ask this question and it may be a duplicate of other similar threads in Stack overflow.Those similar thready does not work in my situation. I am having a quite enough knowledge in spring 3.2 and completed one small project in spring . Now I am new to JSF and I some created basic JSF example .I would like to use the JSF features and its components for my new Spring + JSF project. The links that I came out for JSF + Spring Integration are given below , http://papweb.wordpress.com/2011

Javascript does not work under JSF template

别说谁变了你拦得住时间么 提交于 2019-12-21 02:45:29
问题 I'm using JSF templates and Primefaces. Javascript code does not seem to be working under ui:composition and ui:define tags. The following code is not hitting the loaded() method. This is the content.xhtml file <h:head> <script language="javascript"> function loaded() { alert("Working!!"); } </script> </h:head> <ui:composition template="/template/template.xhtml"> <ui:define name="content"> <h:body style="width:100%;height:100%;" onload="loaded()"> <p class="item">Random text</p> </h:body> <