composite-component

JSF Updating Composite Component (Primefaces)

天大地大妈咪最大 提交于 2019-11-29 05:15:43
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:testForm:j_idt111". My question is why are all these auto generated names being added and how can I control

Is it possible to use template with composite component in JSF 2?

烂漫一生 提交于 2019-11-29 04:53:38
<ui:composition xmlns="http://www.w3.org/1999/xhtml" ... template="inputLayout.xhtml"> <composite:interface> <composite:attribute name="name" /> <composite:attribute name="value" /> </composite:interface> <composite:implementation> <!-- <ui:define name="content"> --> <h:message for="textPanel" style="color:red;" /> #{cc.attrs.name} : <h:inputText id="name" value="#{cc.attrs.value}" /> <!-- <ui:define> --> </composite:implementation> </ui:composition> The problem is that even the ui:define is commented the content is rendered. So it is like the ui:define is ignored or Am I missing some thing ?

How to render a composite component using a custom renderer?

≡放荡痞女 提交于 2019-11-28 20:58:51
I would like to know how to render a composite component, through Java, I mean I have: <myowntags:selectOneRadio> <f:selectItem itemValue="value0" itemLabel="This is the value 0" /> <f:selectItem itemValue="value1" itemLabel="This is the value 1" /> <f:selectItem itemValue="value2" itemLabel="This is the value 2" /> </myowntags:selectOneRadio> or <myowntags:selectOneRadio> <f:selectItems value="#{controller.items}" /> </myowntags:selectOneRadio> and I would like to create a Java class to render it. I know how to render a custom component without using composite, but since, to render a

Tag for body definiton in composite component

泪湿孤枕 提交于 2019-11-28 14:31:52
I am creating a composite component to use it in my application. I need to define for every composite component its own body. When I used JSP few years ago, I specified custom body in some tag file, for example titlebar.tag and future body was declared by tag below: <jsp:doBody /> and I used it in JSP file: <foo:titlebar> <jsp:body> something </jsp:body> </foo:titlebar> now I need to have something similar in JSF composite components between cc:implementation <cc:implementation> SOME TAG FOR FUTURE BODY DECLARATION </cc:implementation> Can you give me an advice please? There the <cc

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

烈酒焚心 提交于 2019-11-28 09:11: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

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

那年仲夏 提交于 2019-11-28 04:41:31
问题 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" /

How to make same JSF Composite Component included multiple times to have its own javascript scope?

倖福魔咒の 提交于 2019-11-28 02:14:06
I have a JSF composite component like this: <cc:implementation> <div id="#{cc.clientId}"> <h:outputScript library="js" name="helper.js"/> <script type="text/javascript"> if(typeof variables === "undefined"){ var variables = {}; } (function(){ variables.formid = '#{cc.clientId}'; })(); </script> </div> Value of variables.formid I'm using in a helper.js file. When I include this composite component only once, it's working like it should. When I include multiple composite components, every component receives the value of a last included composite component, how can I solve this issue? BalusC

Datatable inside programatically added composite component

萝らか妹 提交于 2019-11-28 02:13:35
问题 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

How to refactor snippet of old JSP to some JSF equivalent?

*爱你&永不变心* 提交于 2019-11-28 00:35:33
问题 ORIGINAL JSP (WorkItem.jsp) <c:forEach var="actionItem" items="${workItem.work_action_list}"> <c:if test="${actionItem.workActionClass.work_action_type_id == '1'}" > <%@ include file="inc_done_button.jsp" %> </c:if> <c:if test="${actionItem.workActionClass.work_action_type_id == '2'}" > <c:set var="actionItem" value="${actionItem}" scope="request" /> <c:set var="checklist" value="${actionItem.meat}" scope="request" /> <jsp:include page="inc_dynamic_checklist_v.jsp" flush="true" /> </c:if> etc

Rerendering composite component by ajax

吃可爱长大的小学妹 提交于 2019-11-27 23:23:31
I have build a composite component witch looks something like this: <composite:interface> <composite:attribute name="id" required="false" /> <composite:attribute name="label" required="true" /> </composite:interface> <composite:implementation> <h:panelGroup id="#{cc.attrs.id}"> <fieldset class="fieldset"><legend>${cc.attrs.label}</legend></fieldset> </h:panelGroup> </composite:implementation> The compent displays the current label correctly. <xyz:comp id="idMyComponent" label="#{someBean.text}"/> ... <a4j:ajax ... render="idMyComponent" /> ... Now when the action is preformed nothing happens.