composite-component

Conditionally render element's attribute in a composite component

心不动则不痛 提交于 2019-11-30 15:13:49
问题 I have the following composite component: <?xml version="1.0" encoding="UTF-8"?> <ui:component xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:composite="http://java.sun.com/jsf/composite"> <composite:interface> <composite:attribute required="true"

Conditionally render element's attribute in a composite component

余生颓废 提交于 2019-11-30 14:04:05
I have the following composite component: <?xml version="1.0" encoding="UTF-8"?> <ui:component xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:composite="http://java.sun.com/jsf/composite"> <composite:interface> <composite:attribute required="true" name="field" /> <composite:attribute required="true" name="value" /> <composite:attribute required="false

JSF Updating Composite Component (Primefaces)

一笑奈何 提交于 2019-11-30 07:39:17
问题 I have the following UI Primefaces snippet: <pou:growl id="growl" redisplay="false" showDetail="false" sticky="false" /> When I try to update this item, for example like this: <pou:commandButton value="Update" update=":growl"/> Everything works fine. When I move growl to a composite component however and try to call it (ie. like this): <ez:growl/> I get an error maessage that says: javax.faces.FacesException: Cannot find component with identifier ":growl" referenced from "j_idt84:j_idt85

How to pass a action string into a JSF 2 composite component?

此生再无相见时 提交于 2019-11-30 05:07:29
I'm creating a simple menuing composite component in JSF 2. However, I am unable to pass a String attribute into the composite component to use in the action attribute of the <h:commandLink>. My component looks like: <composite:interface> <composite:attribute name="title" required="true" type="java.lang.String"/> <composite:attribute name="view" required="true" /> </composite:interface> <!--implementation--> <composite:implementation> <li><h:commandLink action="#{cc.attrs.view}" value="#{cc.attrs.title}" /></li> </composite:implementation> How can I get an action String into the action

Prevent direct access to composite components by placing them inside /WEB-INF

只谈情不闲聊 提交于 2019-11-29 15:24:44
I'm trying to define some composite components in my web application. According to the tutorials i read, i have to place the xhtml files inside a resource folder located in webcontent. This solution is problematic, given that it would make those files available for public access from an url. Is there a way to put this components inside the web-inf folder, and make the jsf look for the files there? If not, is there another way to avoid direct access? Thanks. P.S.: I have looked into this answer , and if i understood BalusC's answer correctly, what I intend to do is possible. "Composite

Properties of new tags using composite component are not displayed by Eclipse auto complete shortcurt

倾然丶 夕夏残阳落幕 提交于 2019-11-29 13:59:19
I have developed composite components using JSF 2.0 in Eclipse. I've been putting my XHTML tag files inside resources folder. When I hit ctrl + space in keyboard, the property of the tag are not displayed. I found some tips told to install "Jboss tools" but didn't work. <?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:cc="http://xmlns.jcp.org/jsf/composite" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://xmlns.jcp.org/jsf/core

How to reference #{cc.clientId} in ajax update/process/render/execute?

有些话、适合烂在心里 提交于 2019-11-29 11:10:48
I don't know how to reference descendant components of composite component in update or process (alias render or execute ). I have this composite component resources/components/crud.xhtml : <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jsf/composite"> <c:interface> <c:attribute name="controller" required="true" /> <c:facet name="fields" required="true"/> </c:interface> <c:implementation> <p:dataTable id="table"

Datatable inside programatically added composite component

让人想犯罪 __ 提交于 2019-11-29 08:52:36
Referring to my earlier question ( Programmatically create and add composite component in backing bean ) I have succesfully able to add composite components from backing bean. Now I have a new problem as composite component with lazy datatable in it does not call load() method at all. There was bug report about this ( https://code.google.com/p/primefaces/issues/detail?id=3258 ) but that is marked to be related to PF3.0.RC1 and I have no clue if it is fixed for version 3.5 I am using. I am using the exactly same code BalusC mentioned with possibility to add value expressions to the composite

<my:foo> Tag Library supports namespace: http://java.sun.com/jsf/composite/mycomponents, but no tag was defined for name: foo

梦想的初衷 提交于 2019-11-29 08:22:20
I have a composite component named <my:foo> and I'm building another composite component named <my:bar> . But when I attempt to use <my:foo> inside the <cc:implementation> of <my:bar> , the following exception is been thrown: <my:foo> Tag Library supports namespace: http://java.sun.com/jsf/composite/mycomponents , but no tag was defined for name: foo How is this caused and how can I solve it? This is caused by a bug which was introduced in Mojarra 2.1.8, continued in 2.1.9 and is fixed in 2.1.10. This bug causes that composite component's own XML namespace cannot be declared in a root XML

How to prevent multiple composite components reset themselves on a JSF page?

微笑、不失礼 提交于 2019-11-29 07:55:20
I put this problem in a simple example, a composite component that calculates the sum of 2 inputs and prints the result in an outputText Main JSF page: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ez="http://java.sun.com/jsf/composite/ezcomp/"> <h:head></h:head> <h:body> <ez:Calculator /> <br/> <br/> <ez:Calculator /> <br/> <br/> <ez:Calculator /> </h:body> </html> Composite component 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