jsf

How to access javax.faces.PROJECT_STAGE from the view/inside code?

[My Setup: Java EE 6 application, with EJB3.1, CDI/Weld, JSF2 running on Glassfish 3.0.1] I just read about the Faces ProjectStage on this page, which is a cool thing. So i configured it in my Web.xml, setting it to Development: <context-param> <param-name>javax.faces.PROJECT_STAGE</param-name> <param-value>Development</param-va...

How to implement some if-then logic with JSF and Facelets?

I have a bean with field status. Depending on status value different css class should be applied to render it. So, I need something like this (very far from real things pseudocode): if status == "Approved" cssClass = "green" if status == "Rejected" cssClass = "red" <span class="cssClass">Some info</span> I tried to apply js...

JSF valueChangeListener not fired on form submission

Hi all! On selecting a DIV element, i take the value of the selected DIV's hidden element and pass it on to a form with hidden element in it. This form is then submitted. Below are pieces of my code. The value of the hidden input inside the form is correctly set on selecting the DIV and the form is also submitted but the valueChangeL...

JSF web page include

I am currently working on a JAVA web application using JSF, Facelets, JSTL and EL. I have 10 pages that need to include some HTML and Javascript that I have placed into a inc.jspf. I have tried to use: <jsp:include page="inc.jspf" /> but I am getting an error: The prefix "jsp" for element "jsp:include" is not bound. Is there an...

reRender not working

Hey guys, i have this code below <rich:tab id="tabProcessos" label="Processos"> <a4j:outputPanel id="processos"> <h:form> <rich:dataTable width="800px" value="#{reservaGeralController.lstProcessos}" rendered="#{!empty reservaGeralController.lstProcessos}" var="processoHistorico" id="processosTabela"> ...

JSF Action is not called

Once again I have a problem which I can't find the solution to. A managed bean @Named(value="changeInfoBean") @RequestScoped public class ChangeInfoBean { private String email; private String firstName; private String lastName; /** Creates a new instance of ChangeInfoBean */ public ChangeInfoBean() { F...

JSF: How to add ajax functionality to component in backing bean?

I want to incorporate the functionality to a HtmlCommandButton. How do I go about doing that? I can't seem to find too many examples on the web. I see there is something called AjaxBehavoir, but I'm not sure how to incorporate that into my HtmlCommandButton. Essentially I want to do the following to my component: <f:ajax execute=...

Is it possible to list pages (DataTable paginator="true") with TreeTable? and filterBy in collumn with TreeTable?

I'm new to prime faces and wanted to see if they could use in some way, the paging DataTable (paginator = "true") in TreeTable and filterBy(p: column filterBy = "# MyBackingBea.name") in TreeTable also. The last before mentioned, (filterBy) only worked in DataTable not in TreeTable. The code: <p:treeTable value="#{documentsControl...

How do you choose the filename of an uploaded file in ICEfaces?

How do you choose the filename of an uploaded file in ICEfaces with an ice:inputFile? The reason I want to do this is so that the user can upload multiple files with the same name, without them being overwritten by the server or causing an error. I've tried setting the tag's submitOnUpload attribute to "preAndPostUpload" and making an u...

RichFaces Vs PrimeFaces

I am using JSF 2.0 and I am looking for a copmponent library with minimal load in terms of performance. Which one is better to use if I have choice between RichFaces and PrimeFaces? What are the advantages and disadvantages of both? ...

JSF ViewHandlerWrapper causes NullPointerException

I have a little issue with a JSF ViewHandlerWrapper that I've coded. It works fine most of the times, but at times I will get a NullPointerException from the very core of Mojarra and thus started to wonder whether I implemented my ViewHandlerWrapper correctly. public class TokenViewHandler extends ViewHandlerWrapper { private ViewHa...

How do i get the URL of an <ice:graphicImage> element?

Hello, I'm trying to do a thumbnail gallery on my web page so that when one is clicked the full size image is shown. The images are stored in a backing bean and are shown with an tag. <li> <a href="????"> <ice:graphicImage value="#{screenshot.image}" styleClass="thumb"/> </a> </li> When on the page, I see the...

JSF2 / Primefaces layout performance

Right now I'm using a full page layout and p:layoutUnits and page composition in my webapp. I have a fixed header with a menubar, and a content layoutunit, and that's all. It was easy to set up, but in IE (7) when I navigate to a new page the whole page reloads (visibly), the header is cleared then loaded, and - even more annoyingly - th...

entity manager merge method to update blob field

public void uploadFile(ActionEvent evt)throws Exception{ InputFile inputFile=(InputFile)evt.getSource(); byteArrayOutputStream=new ByteArrayOutputStream(); ObjectOutputStream objectOutputStream=new ObjectOutputStream(byteArrayOutputStream); objectOutputStream.writeObject(inputFile.getFile()); reportTemplate.setTemplatePa...

JSF2: add ui:include to binding object's children

Hi, I have a UIComponent that is binded to a backing bean. I'd like to add a child to the component that corresponds to the ui:include tag, through my backing bean's init method. for example: <p:tab> <ui:include src="/page.xhtml" /> </p:tab> I want to create this in my backing bean like: <p:tab binding="${bean.tab}" /> So ba...

Problem in updating page wise total in JSF datatable when using RichFaces datascroller

I am creating a datatable in my JSF page which shows the footer for every column with the total of values in the column page wise. I am using Richfaces datascroller for paging. When I click next page in richfaces datascroller I need to update my footer with the total of column values in that page, which now a problem for me I managed ...

ICEfaces v2.0.0 Internationalization problem - form is not redisplayed upon action listener call

Hello everyone, I am experiencing problems with localization. i am using JSF 2.0 Mojarra (xhtml not jsp) (2.02 - FCS) IceFaces Core 2.0.0 - beta1 IceFaces Compatibility Library v2.0.0. - beta1 Here is the sample of the xhtml page. DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xh...

Wait message for slow JSF page

I have a jsf page having a request scope bean. A slow database query is fired in the constructor of the request scope bean. Then, the results of the query are shown in a jsf data table on the web page. How do I display a wait message until the database query completes? I tried calling a javascript function for onLoad of tag. The metho...

Definition and practical meaning of @SessionScoped

I would like to understand the full meaning of the @SessionScoped annotation in a JSF ManagedBean. I guess it is related to the http session, but still, it's not very clear to me when it starts, when it ends and if it can be interrupted. If I leave a browser open, without activity, during 2 hours. Is the session still open? Is ...

Moving JSF Managed Beans to Spring beans

I just introduced Spring in a JSF web application, and now I'm feeling tempted to turn my JSF managed beans into Spring beans by moving these beans to the contextConfigLocation XML file (specifying org.springframework.web.jsf.el.SpringBeanFacesELResolver in faces-config.xml) instead of having the beans in the faces-config.xml file. I se...