facelets

Detect page unload with JSF; influencing <body> tag from JSF

Hello I have a JSF web app which, after some user manipulation, opens a connection to an IBM MQ Q Manager, ie does something. When the user navigates away from the page (using FF only) or closes the browser, I would like my app to detect this and close the connection gracefully. All I can find thus far on the web are references to wind...

How to compile facelets?

Many times I had errors like: -tag is not closed(xml error) -xhtml has duplicated id Id like to write validator to check is those errors exist in files. I bet there is some facelets compiler that compile xhtml into java classes and than validates it. ...

How to insert JSF page rendering time and response size into the page itself, at least partially?

I realize it's a chicken and egg problem and that it's not possible to accurately resolve the time it took to render a page (or the size of response) and insert that number into the page itself without affecting either measure. Nevertheless, I'm looking for a way to insert either number partially in a page of a JSF/Facelets/Seam applicat...

In JSF what is the shortest way to output List<SomeObj> as comma separated list of "name" properties of SomeObj

I have a question about outputing a list of objects as a comma separated list in JSF. Let's say: public class SomeObj { private String name; ... constructors, getters and setters ... } and List<SomeObj>: List<SomeObj> lst = new ArrayList<SomeObj>(); lst.add(new SomeObj("NameA")); lst.add(new SomeObj("NameB")); lst.add(new SomeOb...

How to render based on conditions in facelets?

I am using JSF 1.2 + Facelets + Apache My Faces without Tomahawk or other libs. I use a customized container. I have a scenario to implement but I am not sure How to achieve the same using JSF + Facelets. These are my questions : Appreciate any help you can provide. Thanks! Scenario : I have only one page + one backing bean , By default...

JSF / JBoss Seam how-to: splitting one List<Item> over several ListBoxes (h:selectManyListbox)

I'm using these classes: ShoppingCart <-ManyToMany-> Item <-ManyToOne-> ItemCategory All of them are JPA @Entitys with relevant getters and setters for relations: Shopping cart: public class ShoppingCart { ... @ManyToMany public List<Item> getItems() { return items; } ... } Item: public class Item { ... @...

JSF <h:outputFormat>: use array values as parameters

On my JSF2 page, i'm using internationalized error messages. In my backing bean, i'm putting the messages into the flash Scope: flash.put("error", exception.getType()); On the page, this string gets translated this way: <h:outputText value="#{bundle[flash.error]}"/> Works fine. NOW i want to be also able to put (an arbitrary num...

JSF 1.2 facelets custom component

Hi! I am trying to develop custom control in JSF 1.2 (using facelets). I followed steps from different tutorials (defining .tld, taglib.xml, registered component in faces-config.xml and implementing UIComponent (component renders itself) and UIComponentELTag classes) and my component is rendered, I have value bound to it, but attribute...

JSF 2.0 Using Eclipse ?

I am using JSF 2.0 with eclipse 3.4 and Tomcat6. For Facelets I need to create XHTML files. Now the problem is that there is no XHTML file in eclipse. I can make it using a new and convert its etension XHTML but i am coding it is not showing any tags in autocomplete. In JSP file when I write <h: it shows all relevant tags of and same for...

JSF tags not rendered

I am new to JSF, but my JSF tags are not rendered in xhtml file, i tried out every possible solution, but problem is not solved my web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2...

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...

rich:Jquery not working when use in a facelet component

I've created a component that manages postal codes using mask with a rich:jquery, Here the code of the component: <h:inputText id="#{id}-postalCode" value="#{myBeanPath.postalCode}" size="7" /> <rich:jQuery selector="#postalCode" query="mask('a9a 9a9')" timing="onload" /> It works fine in a standard jsf page, but not when it's in ...

Dynamic ui:include inside ui:repeat. Is there a simple solution?

I want to dynamically pick a facelet to render some item in my data list. The first try would be: <ui:repeat value="#{panels}" var="panel"> <ui:include src="#{panel.facelet}"> </ui:repeat> But it won't work since src of ui:include is evaluated too early. The facelet information is truly dynamic, so I cannot use c:forEach (not reall...

where do I place XHTML files to make them visible in GlassFish web container?

This is the structure of my project (exactly these five files): /p1 pom.xml /src /main /java /webapp a.html b.xhtml /WEB-INF faces-config.xml web.xml I'm deploying this WAR to GlassFish and I can successfully access this URL: http://localhost:8080/p1/a.html. When I'm trying to ...

How can I remove HTML comments in my Facelets?

I would like to remove all HTML comments from my facelets before delivering to end users. Does any standard approach exist? ...

How can I remove comments on-fly from my static CSS files?

I'm using facelets, and I have a number of CSS files in webapp/styles/blueprint/*.css. They contain comments which I don't want to become visible to end-users. How can I remove them on-fly? ...

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 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...

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...

SelectOneRadio Problem

I'm trying to do a search form, depending on the selected item you can do searchs by start to end or month and year Is it possible to do a form look like this, with Facelets? using of preference SelectOneRadio ...