composite-component

How to implement a dynamic list with a JSF 2.0 Composite Component?

余生颓废 提交于 2019-11-26 18:51:04
I asked this question and although the answer directly satisfied my needs I am left with a feeling that there has to a simpler solution for this specific problem. I would like to have a composite component that accepts a list of items (The type of the items agreed upon so the members can be used freely within the composite component) The CC (composite component) display the list of items and allows for addition and subtraction of items. I would like to do this in the most simple and efficient manner. To illustrate the problem, an example: The definition should be rather simple (unless of

Binding a managed bean instance to composite component

喜你入骨 提交于 2019-11-26 17:20:04
问题 I have a composite component (collapsiblePanel). The component uses the "collapsible" bean to provide the toggle function. When I use the same component multiple times on a page, each instance of the component is bound to the same bean instance. How Can I achieve something like a component scoped bean? collapsibleTemp.xhtml : <cc:interface> <cc:attribute name="model" required="true"> <cc:attribute name="collapsed" required="true" /> <cc:attribute name="toggle" required="true" method-signature

Using new xmlns.jcp.org namespace on composites causes java.lang.NullPointerException at java.util.concurrent.ConcurrentHashMap.putIfAbsent

只愿长相守 提交于 2019-11-26 16:47:09
问题 I am reading The Java EE 7 Tutorial from http://docs.oracle.com/javaee/7/tutorial/doc/jsf-facelets005.htm#GIQZR After I typed the example code in the chapter 8.5 Composite Components in my IDE and run the example on GlassFish4.0, I got an error java.lang.NullPointerException at java.util.concurrent.ConcurrentHashMap.putIfAbsent(ConcurrentHashMap.java:1078) at com.sun.faces.util.Cache.get(Cache.java:116) at com.sun.faces.application.view.FaceletViewHandlingStrategy.getComponentMetadata

Nested JSF Composite Components leading to a Stack Overflow exception

那年仲夏 提交于 2019-11-26 14:45:53
问题 The problem When I attempt to nest a Composite Component within itself, with some logic to end the infinite recursion I receive a stack overflow exception. My understanding is that <c:xxx> tags run at view build time so I was not expecting to have an infinite view build as I presume has been the case. This is the composite component simpleNestable.xhtml <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http:/

Programmatically create and add composite component in backing bean

佐手、 提交于 2019-11-26 14:05:57
问题 I am working with a dynamic dashboard where users can pin and remove items as they like. Now I have a problem that I want to add existing composite component to the view from the backing bean. I've tried to find correct way to do this from the internet but no success so far. Here is the simple composite component I want to add: <?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

How to programmatically or dynamically create a composite component in JSF 2

折月煮酒 提交于 2019-11-26 13:08:33
问题 I need to programatically create composite components in JSF 2. After few days of searching and experiments I figure out this method (higly inspired by Lexi at java.net): /** * Method will attach composite component to provided component * @param viewPanel parent component of newly created composite component */ public void setComponentJ(UIComponent viewPanel) { FacesContext context = FacesContext.getCurrentInstance(); viewPanel.getChildren().clear(); // load composite component from file

How to create a composite component for a datatable column?

巧了我就是萌 提交于 2019-11-26 09:37:55
问题 Given this datatable (naturally working): <rich:dataTable var=\"var\" value=\"#{values}\"> <rich:column> <f:facet name=\"header\"> HEADER </f:facet> <h:outputText value=\"#{var}\" /> </rich:column> </rich:dataTable> If I define a custom component (also ok in the syntax and at the right place under resources/components): <?xml version=\"1.0\" encoding=\"UTF-8\"?> <html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:ui=\"http://java.sun.com/jsf/facelets\" xmlns:f=\"http://java.sun.com/jsf/core\"

Integrate JavaScript in JSF composite component, the clean way

筅森魡賤 提交于 2019-11-26 09:02:29
问题 In JSF, what would be the \"right\" and \"clean\" way to integrate JavaScript i.e. into a composite-compenent? I am a fan of Unobtrusive JavaScript, and separating HTML from JS from CSS. What would be a good way to have as little quirks as possible? This is what I like the best so far: <composite:interface> // ... </composite:interface> <composite:implementation> // ... <script> initSomething(\'#{cc.clientId}\'); </script> </composite:implementation> What I don\'t like is, to use language A

How to implement a dynamic list with a JSF 2.0 Composite Component?

让人想犯罪 __ 提交于 2019-11-26 06:37:29
问题 I asked this question and although the answer directly satisfied my needs I am left with a feeling that there has to a simpler solution for this specific problem. I would like to have a composite component that accepts a list of items (The type of the items agreed upon so the members can be used freely within the composite component) The CC (composite component) display the list of items and allows for addition and subtraction of items. I would like to do this in the most simple and efficient

When to use <ui:include>, tag files, composite components and/or custom components?

三世轮回 提交于 2019-11-25 23:56:34
问题 I started using JSF 2.0 with Facelets recently and got puzzled by new composite components knowing existing <ui:include> and other templating techniques offered by Facelets 1.x. What is the difference between those approaches? Functionally they seem to offer about the same: <ui:param> vs <cc:attribute> , <ui:insert> + <ui:define> vs tag files, reuse of the existing templates. Is there anything besides syntax and clear interface specification in case of composite components? Could performance