facelets

Backing bean property that should return a string with html code returns empty string

空扰寡人 提交于 2019-12-06 13:33:58
I have a property in my backing bean that returns html code: public String getHtmlPrevisualizar() { return "<html><head><title></title></head><body>Hello world.</body></html>"; } What I want to do is show this html code in a iframe. I do this with javascript. This is the xhtml page: <!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:h="http://java.sun.com/jsf/html" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" xmlns:f="http://java.sun.com/jsf

FaceletContext is Null

大兔子大兔子 提交于 2019-12-06 12:10:41
I have a JSF 2.0 project that I am unable to obtain a FaceletContext from. Here is the setup from my web.xml: <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <context-param> <param-name>javax.faces.PROJECT_STAGE</param-name> <param-value>Development</param-value> </context-param> <context-param> <param-name>facelets.DEVELOPMENT</param-name> <param-value>true</param-value> </context-param> <context-param> <param-name>javax.faces.STATE_SAVING_METHOD</param-name> <param-value>server

Why would my data be available at build time but not at render time?

两盒软妹~` 提交于 2019-12-06 12:03:53
问题 I have read many of the answers and pages but I cannot seem to find a situation similar to my own (I am guessing then, that my mistake is just a bone-head one). I am simply trying to print out a list of items. c:forEach works... but ui:repeat does not (nor do any of my primefaces datagrids/tables). <html xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.prime.com.tr/ui" xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun

Can I add a meta tag to a particular page that is using templates

拈花ヽ惹草 提交于 2019-12-06 12:00:05
I have a page that uses a template <ui:composition template="/WEB-INF/facelets/templates/clientPage.xhtml"> I was hoping to only render the compatibility view for this particular page using the meta tag <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" /> The tag does not work unless I add it to the root template page. Is there a way I can add it to specific pages that use the template. Declare an <ui:insert> in the master template at the desired location: clientPage.xhtml <!DOCTYPE html> <html ...> ... <h:head> <ui:insert name="head-meta" /> ... </h:head> ... </html> Extend the

Browsing file system to select directory in JSF

蓝咒 提交于 2019-12-06 11:12:21
is there a way to implement browsing file system directory in facelets i don't want the user to type the directory i search it in primefaces showcases but i didn't find it . Any help will be appreciated siebz0r For security reasons you cannot browse the filesystem with HTML/JavaScript. If you want to do such a thing you could use a Java applet or a Flash element, but I found such things repulsive. The reason you want to do this is unclear to me. If it's for downloading a file and selecting a destination, you should be using a regular file download. You might want to do more research. I found a

How to pass dynamic parameter to backing bean using EL 2.2 method expression? [duplicate]

一曲冷凌霜 提交于 2019-12-06 11:11:57
This question already has answers here : Invoke direct methods or methods with arguments / variables / parameters in EL (2 answers) Closed 3 years ago . I'm trying to call a function from a JSF 2.0 page in my backing bean passing a dynamic parameter. It works fine as long as im passing a static string, but when I try using a dynamic one, I always get an EL parsing error. I guess its a syntax problem, but I can't think of another way to do this using method expression. I know that I could do it with the <f:param..../> tag, but I'm not going to give up on this one :) <h:dataTable var="urlresult"

How to use the IncludeHandler inside my custom component?

别来无恙 提交于 2019-12-06 10:50:44
问题 In question: The class behind ui:include JSF tag I found out that I need to use the IncludeHandler to use <ui:include> programmatically. However, the constructor needs a "config"-parameter and I don't know how to set this up. Please give an example that shows how to use the IncludeHandler for a simple include like <ui:include src="include.xhtml" /> My jsf-component currently is built programmaticly but I want to include some parts written as ".xhtml". So at the end a web-designer simply has a

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

南笙酒味 提交于 2019-12-06 10:49:23
问题 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? 回答1: 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

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

╄→гoц情女王★ 提交于 2019-12-06 09:55:19
问题 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

f:setPropertyActionListener always setting null

本秂侑毒 提交于 2019-12-06 09:53:26
问题 I'm trying to put the currently iterated <p:dataTable var> as a property of a managed bean using <f:setPropertyActionListener> . However, it is always set as null . The view, dentistas.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:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http:/