jsf-2.0

CDI timeout results in an NPE

Is there a way (in JSF 2) to catch a Conversation timeout and redirect a user to a new page? I'm getting nasty NullPointerExceptions when the conversation times out. I could redirect the user on all NPE's, but that seems like too big a net. ...

JSF: Cannot catch ViewExpiredException

I'm developing a JSF 2.0 application on Glassfish v3 and i'm trying to handle the ViewExpiredException. But whatever i do, i always get a Glassfish error report instead of my own error page. To simulate the occurrence of the VEE, i inserted the following function into my backing bean, which fires the VEE. I'm triggering this function fr...

Why doesn't JSF 2.0 RI (Mojarra) scan my class' annotations?

I have a War and Jar project in my Eclipse-based JSF project. I have decided to use annotations to declare my FacesConverter, (among a myriad other things), rather than declare it using my faces-config.xml. @FacesConverter(value="passwordFieldStringConverter") public class PasswordFieldStringConverter implements Converter { public Ob...

faces-redirect=true in JSF

Hi! I am using the ?faces-redirect=true in my JSF2 since I would like to redirect the user so the URL will be changed. In JSF1.2 I added </redirect> in faces-config. In JSF2 I have to add to my url return home?faces-redirect=true. The problem is that I see faces-redirect=2 in the URL, what I haven't seen in JSF1.2 when I used How ...

JSF 2.0 h:selectManyListbox f:selectItems - always empty

I've got a JSF creation form using a selectManyListbox with selectItems inside (it should contain all tags available for projects). The selectItems list though is always empty - when the page renders, there's nothing in the Listbox. Still, the list in the backing bean contains 3 entries (checked that). What am I doing wrong? The backing...

JSF2 - Why does render response not rerender component setting?

I am getting the following problem: After my view is restored, validation of field causes JSF to skip to Render response phase (because required field is empty). But even though the current value (empty string) is rendered to show to user that he/she did not fill anything, the following statement is not executed: <c:if test="#{empty...

Can we have a component-scoped bean in a JSF2 composite component?

Hi, I was wondering how I could create "component-scoped" beans, or so-to-say, "local variables inside a composite component" that are private to the instance of the composite component, and live as long as that instance lives. Below are more details, explained with an example: Suppose there is a "calculator" component - something tha...

JSF 2: Facelets composition (template) not rendered for error-page

I'm using JSF 2.0 with Facelets in a Java EE 6 application server (GlassFish v3). I have configured an error page for exceptions, in web.xml: <error-page> <exception-type>java.lang.Throwable</exception-type> <location>/error-all.xhtml</location> </error-page> This is the /error-all.xhtml test page: <!DOCTYPE composition PUBLI...

JSF 2.0 with <f:ajax execute="@all" />

Hi, sorry if I am being thick but what is the execute="@all" in an f:ajax tag really supposed to do? I expected it to submit all the elements on a page but it seems to POST only the values in the enclosing form, not all forms on page. For example <h:body> <h:form id="form1"> Input1/Form1 <h:inputText id="testinput" value="...

JSF Form is not showing up

My server is glassfish v3, my browser is firefox 3.6.3 and i am using Netbeans 6.8 My question is why the textfield is not showing up in my browser. I only see the label. <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt...

JSF runtime pagename passing

Hi I have an include page which is a navigation menu. When i click on those menu i want to refresh the content area of layout with a certain page. How can i pass the page name into a JSF page using include tag I dont want to switch to facelets and also i tried using $ and calling the backing bean method. It ...

Rich text editor for JSF 2

Hi, I searched around for a basic WYSIWYG rich text editor that I can use in a JSF 2 (VDL) application, but found nothing satisfactory.. in the sense that: The editor is very extensive, and not configurable (like PrimeFaces) The editor doesn't work with VDL (like RichFaces) Multiple instances of the editor cannot be used on the same p...

JSF ui:repeat and f:ajax giving wrong value for h:inputText after rerender.

I have a list of questions and I can display them ok using a ui:repeat, but after clicking the Edit button the rerendered inputText is given the wrong question.id. For some reason, if you click Edit on the first item, the inputText value assigned is that of the second item in the list, even though other outputs (other than the h:inputTex...

How to call an action from input component's onchange?

Given for example a SelectOneMenu, I can trigger valueChangeListeners or rerendering of page fragments via f:ajax: <h:selectOneMenu valueChangeListener="..." ... > <f:ajax render="@form" execute="@form" /> </h:selectOneMenu> That's nice, but I want to do some more complicated stuff when the box changes (if validation is passed). Is ...

@EJB in @ViewScoped managed bean causes java.io.NotSerializableException

Hi, I've been banging my head around with a @ViewScoped managed-bean. I'm using primeface's "schedule" component in order to display some events. When the user clicks on a specific button a method in the viewscoped bean is called using ajax but every time I get a "java.io.NotSerializableException", if I change the managed-bean scop...

JSF 2.0 Problem

I am doing a project where I am using JSF 2.0 & Primefaces UI Components. There is a tab view component with tabs, "Day","Week" & "Month". In all tab, I have to display Bar Charts in each. For the same, I am fetching three list using the following three method. In the following code, UpdateCountHelper is fetching the data from database...

JSF 2.0 Problem (faces-config)

We have faces-config.xml in JSF 1.0 where we entry about managed-beans, dependencies & navigations etc. I was developing a sample project using JSF 2.0. But, as I don't know annotation, I need to include face-config.xml externally. Please, provide the solution for it, as in JSF 2.0 we don't need to include it. What is reason behind it? ...

JSF2 set a UISelectItem to not render. With a custom MenuRenderer

Hi, I have a managed bean that contains a collection of UISelectItem instances. How can i tell one instance to not render? Setting the selectitem.setRendered(false) still renderes that item... I'd like to manipulate the UiSelectItem instance. So basicly i have a h:selectOneMenu that gets populated by this collection by f:selectItems. Bu...

How to Get JSF 2.0 Working with Eclipse 3.5 and JBoss 5.1

I am running Eclipse 3.5 and JBoss 5.1. I want to create a JSF 2.0 project. I heard here that the Eclipse JBoss Tools plugin version 3.1 (available here) could do this for me. I have installed the plugin. However, if I go to the Project Facets properties page for a Dynamic Web Project, I only see Facets for JavaServer Faces 1.1 and 1...

JSF 1.0 vs JSF 2.0

What is difference between these 2 version ? As a freshes to java, I just only got that, the difference is only at the point at architectural level. But, at a long perspective, I can't get that how much it affects to java ? Also, the MVC changes with JSF and Spring. Even if JSF has improved architecture, still Spring is in better use. Wh...