composite-component

Putting JSF composite components in a subfolder based hierarchy

折月煮酒 提交于 2020-01-05 07:17:15
问题 I'm roughly following this guide for creating composite components in JSF 2.2. I've managed to define and use a component, but I'm having problems properly organizing the components. In all tutorials the components are put into one directory and the files' names define the tag name. META-INF/resources/ts +-plainbox.xhtml +-showcasebox.xhtml I'd prefer having categories and a directory for each element, with bundled JS, CSS and images. I'd like to use a structure like this: META-INF/resources

Invoke ActionListener of Backing Component in Composite Component

喜欢而已 提交于 2020-01-03 05:54:09
问题 try to write a composite component that allows mutltiple text inputs. I read that it is possible to define a backing component for a composite component, so I don't have to write a renderer nor a handler. What I couldn't figure out is how to delegate actions declared in composite's xhtml to the backing component. I guess i did not yet quite understand the concept of this. Does anybody has an Idea? I am using Tomcat 7, EL 2.2, Spring 3, Mojarra 2.1.7 This is the way i'd like to use the

Composite component required=“true” not respected

 ̄綄美尐妖づ 提交于 2020-01-02 05:45:08
问题 In the composite:interface I have defined an attribute like this: <composite:attribute name="myAttribute" required="true"/> Now when I use my composite component like this, without defining any attributes: <myTag:myCC/> I would expect an error to occur. It doesn't. What could I possibly be missing? 回答1: It will only occur if your JSF project stage is set to Development as follows in web.xml : <context-param> <param-name>javax.faces.PROJECT_STAGE</param-name> <param-value>Development</param

Duplicate component ID in JSF using composite component twice in view

最后都变了- 提交于 2020-01-02 05:11:49
问题 I "inherited" a JSF 2 (JSF 2.2.7) application in my company and facing a java.lang.IllegalStateException because two component seem to have the same ID. The structure of the view is as follows (I extracted the relevant code for illustration purpose, it may contain some typos/invalid syntax as I changed some names): <p:commandButton id="editButton" action="#{controller.prepareItem()}" update=":itemEditDlg" oncomplete="PF('itemtEditDlg').show()" /> <comp:editItemDlg id="itemEditDlg" /> <p

How to reference value declared in cc:attribute in cc:implementation

蓝咒 提交于 2019-12-31 04:30:09
问题 I have a simple JSF 2.0 composite component example. <!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://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"> <head> <title> A panel box component </title> </head> <body> <cc:interface> <cc:attribute name="model" required

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

做~自己de王妃 提交于 2019-12-31 04:00:23
问题 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

Using composite:insertFacet/renderFacet does not work inside t:dataTable

别说谁变了你拦得住时间么 提交于 2019-12-31 00:44:53
问题 I'm doing this: resources/vm/table.xhtml: ... <composite:interface> <composite:facet name="dataBody" required="true"/> </composite:interface> ... <composite:implementation> <t:dataTable> <composite:renderFacet name="dataBody"/> </t:dataTable> </composite:implementation> ... And in page.xhtml: ... <vm:table> <f:facet name="dataBody"> <t:column> Testing. </t:column> </f:facet name="dataBody"> </vm:table> ... Problem: The 'dataBody' facet is not rendered. In JSF1.2 I used to do this with ui

JSF 2 composites and binding for validation

谁都会走 提交于 2019-12-30 11:15:58
问题 I have a problem with a JSF composite which validates internal input fields. Following code snippet works as long as only one composite is included. <div id="#{cc.clientId}" > <h:panelGroup styleClass="#{not firstname.valid ? 'fmError' : ''}"> <div class="col220"> <h:outputLabel for="firstname" value="Vorname(n):" /> </div> <div class="col220"> <h:inputText id="firstname" styleClass="fmTxt " value="#{cc.attrs.person.firstname}" binding="#{firstname}"> <f:validateRequired /> </h:inputText> <

How to access the parent Naming Container of Composite?

一世执手 提交于 2019-12-30 06:49:17
问题 I have a JSP 2.0 <ui:component> , within that is a <p:dataTable> with a column that uses a Composite to render a special border about some content. Now I need to identify the <p:dataTabe> in a ajax rendered attribute that is located in the content. <ui:component> <p:dataTable id="dataTable" var="userItem" ... /> <p:column> <my:borderBox id="borderBox"> <p:commandButton action="#{userController.doDelete(userItem.id)}" value="delete" update="?????"/> <!-- How to address the dateTable? --> </my

Change composite-component's namespace

会有一股神秘感。 提交于 2019-12-29 09:18:10
问题 I have a small library (JAR) containing some custom JSF-components. Some of them are composite-components which are completely (or partly) implemented in XHTML files which reside under META-INF/resources/my-components . To use these components from other XHTML-files I have to use the XML-namespace http://xmlns.jcp.org/jsf/composite/my-components . Other related components in this library are implemented as POJOs using @FacesComponent (and @FacesRenderer ). To use these components, I have to