facelets

Pass Argument to a composite-component action attribute

好久不见. 提交于 2019-11-27 07:01:24
The title really says it all. I have made an attempt which failed with the error: Illegal attempt to pass arguments to a composite component lookup expression (i.e. cc.attrs.[identifier]). My attempt looks like this: <composite:interface> <composite:attribute name="removeFieldAction" method-signature="void action(java.lang.String)" /> </composite:interface> <composite:implementation> <h:commandButton value="Remove" action="#{cc.attrs.removeFieldAction('SomeString')}"/> </composite:implementation> What's the right way to do this? This is indeed not going to work. You cannot pass "extra"

When to use f:view and f:subview

China☆狼群 提交于 2019-11-27 06:27:32
I am not sure what are the benefits of using <f:view> and <f:subview> . I noticed that one could write JSF pages without using them. What are the benefits of using those tags? BalusC <f:view> The <f:view> is only useful if you want to explicitly specify/override any of the available attributes such as locale , encoding , contentType , etc or want to attach some phase listeners. E.g. <f:view locale="#{user.locale}" encoding="UTF-8" contentType="text/html"> If you don't specify it, then the sane JSF defaults will just be used instead, which is respectively UIViewRoot#getLocale() , UTF-8 and the

Warning: This page calls for XML namespace http://www.facebook.com/2008/fbml declared with prefix fb but no taglibrary exists for that namespace

血红的双手。 提交于 2019-11-27 06:19:56
问题 I am developing an application for FB Login with website using Javascript. I tried in html it works fine. when i convert into JSF it gives an error. This is my fbLogin.xhtml code. <?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:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:fb="http://www.facebook.com

Include dynamic content containing JSF tags/components from stream

旧城冷巷雨未停 提交于 2019-11-27 05:32:29
I am working on an application where I would like to include dynamic XHTML content from a stream. To handle this I wrote a taghandler extension which dumps the dynamic XHTML content to output component as UIOutput htmlChild = (UIOutput) ctx.getFacesContext().getApplication().createComponent(UIOutput.COMPONENT_TYPE); htmlChild.setValue(new String(outputStream.toByteArray(), "utf-8")); This works fine for XHTML content which has no JSF tags. If I have JSF tags in my dynamic XHTML content like <h:inputText value="#{bean.item}"/> , then they're printed as plain text. I want them to render as input

Passing the backing bean as a parameter to a Facelet include

点点圈 提交于 2019-11-27 05:27:22
I have a Facelet that might be used in different applications. I don't to copy it, but reuse it. I need to pass the backing bean that will manage the view as a parameter, as some logic may vary according to the application where it is used in. I don't want to use a composite component, but just include the Facelet and specify which bean will manage the view. How can I achieve this? Let me give an example: <ui:composition template="/resources/common/templates/template.xhtml" xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns

Why is the getter called so many times by the rendered attribute?

家住魔仙堡 提交于 2019-11-27 05:01:35
Related to a previous example, i tried to monitor my get/set methods on the server (when they are called, and how often). So, my actual been look such : @ManagedBean(name="selector") @RequestScoped public class Selector { @ManagedProperty(value="#{param.profilePage}") private String profilePage; public String getProfilePage() { if(profilePage==null || profilePage.trim().isEmpty()) { this.profilePage="main"; } System.out.println("GET "+profilePage); return profilePage; } public void setProfilePage(String profilePage) { this.profilePage=profilePage; System.out.println("SET "+profilePage); } }

javax.faces.view.facelets.FaceletException: Error Parsing /my.xhtml: Error Traced[line: 42] The prefix “f” for element “f:facet” is not bound

Deadly 提交于 2019-11-27 04:51:38
问题 I would like to create table which can display data from database into JSF page. I found this code: <h:dataTable value="#{bookStore.items}" var="store"> <h:column> <f:facet name="header"> <h:outputText value="#{msg.storeNameLabel}"/> </f:facet> <h:outputText value="#{store.name}"/> </h:column> <h:column> <f:facet name="header"> Subject </f:facet> <h:outputText value="#{store.subject}"/> </h:column> <h:column> <f:facet name="header"> <h:outputText value="#{msg.storePriceLabel}"/> </f:facet> <h

Why does @PostConstruct callback fire every time even though bean is @ViewScoped? JSF

℡╲_俬逩灬. 提交于 2019-11-27 03:34:44
I am using datatable on page and using binding attribute to bind it to my backing bean. This is my code :- <?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:p="http://primefaces.prime.com.tr/ui"> <h:head> <title>Facelet Title</title> </h:head> <h:body> <h:form prependId="false"> <h:dataTable var="item" value="#{testBean.stringCollection}" binding="#{testBean.dataTable}"> <h:column> <h:outputText

JSF facelets template packaging

江枫思渺然 提交于 2019-11-27 03:28:42
As always, i'm a little confused. Here https://community.jboss.org/wiki/ModularWebAppsWithJSF2 i've learned that it is easy and works out of the box to bundle templates in separate jars since JSF 2.0. The only problem is: i can't get it working. I simply deploy a "page.xhtml" in all flavors (META-INF directory, resources directory, root; with and without faces-config.xml) in a jar that is included in the web application WEB-INF/lib and request something like http://host/demo/faces/page.xhtml or do an "include" or "decorate" on the template. I get an exception. Here Java EE6> Packaging JSF

Error Parsing /page.xhtml: Error Traced[line: 42] The entity “nbsp” was referenced, but not declared

ぐ巨炮叔叔 提交于 2019-11-27 03:25:15
I'd like to use non breaking spaces in my JSF page. I know, in plain HTML I could use   for this and this works fine. However, when I put those   in a Facelets page, then it errors as follows: Error Parsing /page.xhtml: Error Traced[line: 42] The entity "nbsp" was referenced, but not declared. How is this caused and how can I solve it? Facelets is a XML based view technology. XML has only five predefined entities . The   is not among them. It works only when used in plain HTML or in legacy JSP (note: it doesn't work in JSPX as that's also XML based!). To fix this, you either need to declare