facelets

Regarding communication between managed bean in JSF

你离开我真会死。 提交于 2019-12-12 15:11:42
问题 It seems I am not clear on my previous question about managed bean. So, I am posting it again in a more systematic manner. I have one page: <?xml version='1.0' encoding='UTF-8' ?> <!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:ui="http://java.sun.com/jsf/facelets"> <h:head> <title>Facelet Title</title> </h:head> <h:body> <ui:insert

<p:commandButton> doesn't navigate when actionListener=“#{bean.method}” is declared

筅森魡賤 提交于 2019-12-12 10:59:35
问题 I am trying to create a page which allows a user to logon to the system and then navigates to the homepage. I have managed to get it to do one or the other but cannot work out how to get it to do both. I have crawled through all the sites and cannot find a suitable answer. Please help. My code is as follows: XHTML: <h:form> <p:growl id="growl" showDetail="true" life="3000" /> <h:panelGrid columns="2" cellpadding="5"> <h:outputLabel for="username" value="Username: " /> <p:inputText value="#

Ok to wrap JSF components generated html with own divs using jQuery after page load?

蹲街弑〆低调 提交于 2019-12-12 10:23:07
问题 Using RichFaces 3.3.3, JSF 1.2 and Facelets. For some presentation purposes I need to wrap the contents of some divs with other divs to be able to style them a certain way. I am using jQUery to do this as its cleaner when writing HTML and it can be controlled in one location, otherwise I have to hardcode the extra divs every place I want to use them. eg. original JSF generated HTML: <div id="j_id4:main-container"> <div id="j_id4:j_id5:nav">...</div> </div> after using jQUery the HTML now

JSF 2.0 and Facelets

ぐ巨炮叔叔 提交于 2019-12-12 08:56:37
问题 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. 回答1: It should works fine. More information and working example you can find in IBM developer works article and following articles in this series. 回答2: How to configure/use Facelets is outlined the Java EE 6 tutorial: Developing a

Facelet tag parameter not recognized by PrimeFaces p:ajax

删除回忆录丶 提交于 2019-12-12 08:43:58
问题 I have a simple Facelet tag: <ui:composition> <ui:insert /> </ui:composition> which is used in order to avoid declaring multiple c:set tags. Let's say I registered it in the facelets taglib library with the name view , and use it like this: <my:view bean="#{myController}"> <p:inputText value="#{bean.value}> <p:ajax event="blur" process="@this" listener="#{bean.handleValueChanged}" /> </p:inputText> </my:view> The attribute value is perfectly resolved by p:inputText , but p:ajax throws this:

Mapping JSF .xhtml files to no extension

蓝咒 提交于 2019-12-12 07:15:15
问题 In JSF I can map the Faces Servlet to various URL patterns. E.g. to *.xhtml . What I want however is map the Faces Servlet to no extension. Meaning, if I have a page customers.xhtml in my web root, I would like to request this using http://example.com/customers . I looked at the question How do I configure JSF url mappings without file extensions? and this works to some degree, but it requires me to map each and every file I have individually (correct me if I'm wrong). How can I map all my

How to display menu items from database

筅森魡賤 提交于 2019-12-12 05:39:36
问题 I have two classes representing menu items. First one is Category , it represents the parent menu items. @Entity @Table(name = "category") @NamedQueries({ @NamedQuery(name = "Category.findAll", query = "SELECT c FROM Category c"), @NamedQuery(name = "Category.findByCateId", query = "SELECT c FROM Category c WHERE c.cateId = :cateId"), @NamedQuery(name = "Category.findByCateName", query = "SELECT c FROM Category c WHERE c.cateName = :cateName")}) public class Category implements Serializable {

JSF returns blank/unparsed page with plain/raw XHTML/XML/EL source instead of rendered HTML output

萝らか妹 提交于 2019-12-12 05:29:49
问题 I have some Facelets files like below. WebContent |-- index.xhtml |-- register.xhtml |-- templates | |--userForm.xhtml | `--banner.xhtml : Both pages are using templates from /templates directory. My /index.xhtml opens fine in browser. I get the generated HTML output. I have a link in /index.xhtml file to /register.xhtml file. However, my /register.xhtml is not getting parsed and returns as plain XHTML / raw XML instead of its generated HTML output. All EL expressions in form of #{...} are

jsf 2.0 @ViewScoped redirect (navigation) to target=“_blank”

好久不见. 提交于 2019-12-12 04:58:25
问题 Basically the same question as here How do I retain a ViewScoped bean on the page from which I redirect to a different browser tab: firstPage.xhtml: <h:commandLink action="#{controller.redirect}" value="#{bean.value} target="_blank"/> When redirect/navigation finishes with initializing the other beans, it destroys this #{bean} in the process. In the redirected code I am not even using #{bean}. This used to work with <a4j:keepAlive> Here's my current setup. bean class: @ViewScoped public class

viewParam event going wrong

旧时模样 提交于 2019-12-12 03:56:56
问题 I created a webpage, which checks the view-parameter from the URL, and calls the init-method of a bean to retrieve that user. The fields on that page are then filled with the information of that user. But something is going wrong. My Facelets page: <?xml version='1.0' encoding='UTF-8' ?> <!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"