jsf-2.0

JSF 2.0: Action doesn't work

Hi guys, I set up a JSF2.0 project with maven. Everything works fine exept action handling :-( Here is my .xhtml page: <h:form> <h:commandButton id="submit" value="Absenden" action="#(projectController.saveProject)"> </h:commandButton> </h:form> and here my managed bean: @ManagedBean @SessionScoped pub...

Can't seem to redirect from a ViewScoped constructor.

I'm having trouble redirecting from a view scoped bean in the case that we don't have the required info for the page in question. The log entry in the @PostContruct is visible in the log right before a NPE relating to the view trying to render itself instead of following my redirect. Why is it ignoring the redirect? Here's my code: @Ma...

Passing a parameter with h:commandButton

I have a a4j:commandButton which is supposed to redirect me to an appropriate "Edit" page based on an Id, which I wanted to pass as a parameter, something like this: <h:commandButton action="/details.jsf?faces-redirect=true" value="details"> <f:attribute name="id" value="#{bean.id}" /> </h:commandButton> The problem is, it doesn't...

Getting Entitymanager/EJB inside a @FacesConverter/Validator of a WAR-packaged app

I have a JavaEE6-application running on Glassfish v3.0.1 with EJB 3.1 (app is packaged as WAR), and all my EJBs are @LocalBeans. Currently, i'm writing a FacesConverter for use in JSF2, in which i need the EntityManager to get an Entity back from an id. Now i wonder, which is the best and cleanest way to get the Entitymanager inside th...

How to Inject ManagedBeans in JSF2.0

Hi folks, I have got Controller-ManagedBeans and Model-ManagedBeans (like MVC-Pattern). Here my Controller: @ManagedBean @RequestScoped public class ProjectController { private ProjectData projectBean; //The Model-ManagedBean (see below)! private IProjectService projectService; //My Service-Layer public ProjectCon...

How do I enable choosing a row of a h:dataTable using JSF 2.0?

Hello, I'm starting a small project, using JSF 2.0. I'm having problems right in the start, in the CRUD of the first model implemented. What I want to do is pretty simple: The page has some filters to search, and using ajax, it populates a h:dataTable with the results. The user should now select the line with the result he wants to se...

JSF2.0 tags not found.

Recently I've been playing around with JSF2.0+Richface 3.3.3, I'm using STS as my IDE and Maven to build my project, but somehow I can't get the following JSF2.0 tags to work: h:button h:link f:metadata f:viewParam (this is the only one my STS autocomplete recognizes) It just fails during runtime saying it can't find X component. I ...

Navigate to external URL from a backing bean?

I'm trying to implement proper logout for my Java EE / JSF2 application. It requires two things: I need to logout from JAAS and invalidate the session I then have to navigate to an external URL to fire Siteminder logout The Siteminder logout URL (configured on the Policy server -> I cannot change it) is outside my applications conte...

h:dataTable problem - Target model Type is no a Collection or Array

Hi, I've been literally struggling with this, although there are tons of tutorials on the topic. I'm testing the functionality of the h:dataTable component in JSF 2.0. I have the following list: <h:dataTable border="1" styleClass="data zebra" value="#{testTableWB.testList}" var="items"> <h:column> <...

Accessing images with CSS url() in Primefaces

This is from the Primefaces docs: Button Icons An icon on a button is displayed using CSS and image attribute. <p:commandButton value=”With Icon” image=”disk”/> <p:commandButton image=”disk”/> .disk is a simple css class with a background property: .disk { background-image: url(‘disk.png’) !important; } ...

Making p:commandButton work like h:button

I have this working code in my webapp: <h:button value="Edit user..." outcome="/public/user" > <f:param name="userName" value="#{authBean.authUser}"/> </h:button> What it does: It makes the button send a GET It passes the specified parameter in the URL, making it bookmarkable. What I need: It should work like h:button above ...

icefaces 2 beta 1: binding selectmanycheckbox to map raises conversion error

Hi, if i want to bind the value-attribute of a h:selectmanycheckbox to a map, with the ri of the jsf 2.0.3 i would do something like the following the bean: private Map<String, String[]> values = new HashMap<String, String[]>(); public Map<String, String[]> getValues() { return values; } public void setValues(Map<String, String[]...

c:if test is not being invoked in facelet + JSF2

Hi! I am using facelet and JSF2. I define a parameter in a page: <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.prime.com.tr/ui" template="../templates/ui.xhtml"> <ui:param na...

JSTL in JSF2 Facelets... makes sense?

Hi all, I would like to output a bit of XHTML code conditionally. For that purpose, the JSTL tags seem to work fine: <c:if test="${lpc.verbose}"> ... </c:if> However, I'm not sure if this is a best practice? Is there another way to achieve my goal? Thx J. ...

Removing JSF messages from the flash

I have one page that does something and when the user clicks a button, the user is redirected to another page and a message is displayed. Here is my code: public String confirm() { FacesContext context = FacesContext.getCurrentInstance(); Flash flash = context.getExternalContext().getFlash(); flash.setKeepMessages(true); ...

Does the jsf lifecycle apply to the outcome facelet when I click a button?

I have a simple login.xhtml facelet which contain a username and password input and a command button. The command button simply have an action="welcome" outcome which display the welcome.xhtml facelet. I'm very new to JSF. As i read the JSF lifecycle, when i click the button then the invoke application lifecyle handle the navigation and...

Submit Listener Method in the BackBean is not getting invoked.

My result tables/images will be displayed in the same page. But the submit button is not invoked. I have two drop downs on which the values of the other two drop downs are dependent. If I am writting immediate="true" the method is invoked but only two values are set with whom I have associated processValueChange action the other selected...

Why jsp: tags are not parsed?

I have this login.xhtml JSF page: <?xml version="1.0"?> <jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"&gt; <jsp:directive.page contentType="text/html"/> <f:view> <h:inputText value="#{userBean.id}"/> </f:view> </jsp:root> Output HTM...

How to overcome caching problem of jsf?

I have 7 drop down in my jsp(Using JSF tag-Select One Menu), 2 drop downs are dependent on other 2 drop downs. The scope of my Managed Bean is session.I have a single page and my result is a graph/table depending on the drop down menu selection. But my selection is getting cached and at times on refreshing the code my bean and my jsp pag...

JSF: display h:selectManyCheckBox vertically in h:dataTable

I have a simply facelet which display a list of products in tabular format. In the last column of each row, there is a checkbox used to mark the product for deletion. Until now i have to put a selectBooleanCheckBox on each row and have a "mark for deletion" property in the Product entity but i think it's ugly because i have some presenta...