facelets

Facebook social plugins and JSF

蹲街弑〆低调 提交于 2019-12-04 21:22:51
I have to integrate the Facebook social plugins into a JSF application. This recommends that I add the fbml namespace to the xhtml file that it's rendered in the response. I have in my XHTML file: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" ... xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://ogp.me/ns#"> But the fb and og namespace won't be shown in the rendered source, only the XHTML namespace. How can I get these

ui:composition template=“<template from jar>”

穿精又带淫゛_ 提交于 2019-12-04 16:45:42
I would like to place the Facelets template file for JSF in a JAR file. I tried to reference it by EL as <ui:composition template="#{resource['templates:template_pe_layout.xhtml']}"> which works perfect for CSS or images, but not for the composition template. How could I achieve the goal? BalusC The #{resource} expression is initially designed for use inside CSS files only like so .someclass { background-image: url(#{resource['somelibrary:img/some.png']}); } It's not intented for usage in <h:outputStylesheet> , <h:outputScript> or <h:graphicImage> which should rather be used as follows: <h

How to create a composite component which switches between inputText and inputSecret?

懵懂的女人 提交于 2019-12-04 16:17:36
I'm writing a Facelets composite component that switches between using inputText and inputSecret based on a parameter: <composite:interface> <composite:attribute name="myId" required="true"/> <composite:attribute name="secret" required="false" default="false" /> </composite:interface> <composite:implementation> <h:inputSecret rendered="#{cc.attrs.secret}" id="#{cc.attrs.myId}" /> <h:inputText rendered="#{!cc.attrs.secret}" id="#{cc.attrs.myId}" /> </composite:implementation> The problem is that I get the following error: Component ID [JSF mangled id] has already been found in the view. BalusC

JSF 2.0 composite component into jar

匆匆过客 提交于 2019-12-04 15:53:49
I'm trying create a composite component to use across my projects, so, I've created a project called "componentes-ui-web" and putted 2 xhtml files that are my components. The structure of the project is like this: src > |-> main > > |->java > > |->META-INF > > |->faces-config.xml > > |->resources > > |->componentes > > |->popupSimples.xhtml > > |->popupSubmit.xhtml This is the code of popupSubmit.xhtml : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun

Deploy JSF composite components for shared use

不打扰是莪最后的温柔 提交于 2019-12-04 15:20:05
I work on a Java EE project which is planned to become quite large in future and I want to share as much code as possible. This included not only Java code, but also code for UI elements. I think about developing enterprise components based on clear defined subjects (like user administration, taxes, products) which interact on basis of messages, beans and so on. I also think about giving all these components some managed beans and JSF composites to provide some basic functionality for later use in the web UI. That's the context... To make it concrete: Let's say I have an EAR (um.ear) for user

JSF 2.0 and Facelets

穿精又带淫゛_ 提交于 2019-12-04 12:47:17
In blogs i have read that JSF 2.0 is inlcuding Facelets. So i only included JSF-api.jar and JSF-impl.jar to my Java build path. But if i try to use Facelet tags, they don't work. Do i need to configure Facelets anywhere or must i include any further libraries? THX. It should works fine. More information and working example you can find in IBM developer works article and following articles in this series . How to configure/use Facelets is outlined the Java EE 6 tutorial: Developing a Simple Facelets Application (also check the subsequent pages). You're likely forgotten to declare the ui taglib.

Using one component (dataTable) id inside composite component

核能气质少年 提交于 2019-12-04 12:24:07
How can I use id of DataTable Component (Primefaces 2.2.1) inside Composite Component in Java Server Faces 2.1 ? Now, I have a view: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.prime.com.tr/ui" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:haiq="http://java.sun.com/jsf/composite/haiqcomponents" template="/WEB

How to create a reuseable template with header/footer/navigation?

可紊 提交于 2019-12-04 12:01:56
问题 I have been playing with JSF and have a project working that has a header/footer/navigation/content panels. The project, however, goes from page 1 to page 2, etc., with each page having a different layout. How can I create a reusable template that keeps the same look and feel from page to page, i.e., header/footer/navigation stay the same, but content is updated? 回答1: This sounds like a classic case of a master template. In such a template you put everything that's common to all pages and

How to define an onLoad function in JSF template that will be defined elsewhere

核能气质少年 提交于 2019-12-04 10:19:21
I'm designing the view for my site, which has a standard login and landing page, and I want to have an onLoad function called for my login page, but not for my other pages (yet). I've got a template.xhtml file, which has this insert: <div id="content"> <ui:insert name="content"/> </div> Then in login.xhtml I have: <ui:define name="content"> ... </ui:define> Normally I would put this in login.xhtml: <body onload="document.getElementById('login_form:name').focus();"> But since I'm using JSF's ui composition tags, I can't have the <body/> tag in login.xhtml (at least the way I am attempting to do

Conditionally including a Facelet file via <ui:include>

拟墨画扇 提交于 2019-12-04 05:51:40
问题 I have 2 Facelets files (index.xhtml and report.xhtml). I use the RichFaces <ui:include src="report.xhtml"/> to load the report into the index. Works fine. But when I try to only show report on certain conditions, I fail! What does not work is this: <ui:include src="report.xhtml" rendered="#{indexService.contentName == 'report'}"/> . The rendered attribute of ui:include does not seem to work. How can I load the report.xhtml into the index.xhtml on certain conditions? Where is the error in my