composite-component

How can I create a JSF composite component that binds a Collection to both an h:selectOneMenu and h:selectManyListbox?

◇◆丶佛笑我妖孽 提交于 2019-12-23 03:36:11
问题 I'm trying to create a composite component that will allow the user to toggle between a h:singleSelectMenu and h:selectManyListbox. I have it working sort of. It works as long as the value field points to a Collection...it does NOT work if the value field is null. singleMultiSelect.xhtml <?xml version="1.0" encoding="US-ASCII"?> <!DOCTYPE html> <ui:composition xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:cc=

Thymeleaf composite components

两盒软妹~` 提交于 2019-12-22 18:19:35
问题 Is there any way of making composite components (like in JSF) using Thymeleaf? I found out how to send parameters to fragments that can be retrieved using the expression language. But I haven't figured out how to send markup to fragments like you can in JSF. For example, I have several pages that have very similar menus on the left. I would like to be able to use a single fragment on all my pages, but passing some markup to be displayed at the bottom of the menu. Some pages have to display

How to evaluate MethodExpressions in JSF composite components

点点圈 提交于 2019-12-22 08:55:04
问题 I am not sure about the "correct" way to deal with method expressions in composite components. My composite uses a backing class with action methods. Theses perform some default actions or delegate to an action method passed by the composite user as an attribute: In using page: <my:component action="#{myBean.actionMethod}" /> Composite: <cc:interface componentType="mycomponentType"> <cc:attribute name="action" method-signature="java.lang.String action()" required="false" /> </cc:interface>

Using one component (dataTable) id inside composite component

筅森魡賤 提交于 2019-12-21 20:47:44
问题 How can I use id of DataTable Component (Primefaces 2.2.1) inside Composite Component in Java Server Faces 2.1 ? Now, I have a view: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.prime.com.tr/ui" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http:/

jsf difference between implicit objects cc and component

隐身守侯 提交于 2019-12-21 19:53:09
问题 Maybe this is a dumb question, but I use cc to refer to the composite component, for instance cc.attrs.randomAttr but I have also seen the component implicit object and I have used it because I was told to but I don't really understand what it is for. Can anyone explain please? 回答1: cc refers to the top level composite component that is being processed at the time of evaluation. component simply is the ui component being processed. So when inside a composite component, cc refers to the

JSF composite components in JAR not recognised in NetBeans

冷暖自知 提交于 2019-12-21 04:24:11
问题 I have added a common JAR to my project. The jar looks something like... CommonWeb.jar |-- META-INF | |-- resources | | `-- common | | |-- css | | | `-- my.css | | |-- js | | | `-- my.js | | |-- images | | | `-- my.png | | |-- components | | | `-- mycomposite.xhtml | | `-- templates | | `-- mytemplate.xhtml | |-- faces-config.xml | `-- MANIFEST.MF : Everything is working except that Netbeans will not recognise my composite component. The page trying to use the component looks something like

How does a composite component set a property in it's client's backing bean?

两盒软妹~` 提交于 2019-12-20 10:48:27
问题 I have a composite component with an interface that contains this: <cc:attribute name="model" shortDescription="Bean that contains Location" > <cc:attribute name="location" type="pkg.Location" required="true" /> </cc:attribute> </cc:interface> So I can access the Location object in the markup with #{cc.attrs.model.location} . I also access that object from the backing bean of the composite component like this: FacesContext fc = FacesContext.getCurrentInstance(); Object obj = fc.getApplication

Execute JavaScript from a Composite Component

蓝咒 提交于 2019-12-20 04:34:48
问题 Good day, I have a problem that has annoyed me for a couple of hours now. It's very straight forward. I try to invoke/execute a JavaScript when the composite component is rendered. Like what you can do with the html tag body and onload. How can I reference the in-line JavaScript to be executed ? <cc:implementation> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false" /> <div id="#{cc

JSF2 composite components: are #{cc.childCount} and <composite:insertChildren/> mutually exclusive?

痴心易碎 提交于 2019-12-19 18:52:10
问题 I just dont get it: If I want my composite component to insert children, I use <composite:insertChildren/> but #{cc.childCount} always returns 0 in that case. On the other hand, If I do not use <composite:insertChildren/> I always get correct childCount without children being rendered. Why is that happening? All I want to do in my component is to render some "default" panel if there are no children and do not render it in other case - behavior similar to <ui:insert name="param_name">default

What is the difference between Custom Components and Composite Components?

牧云@^-^@ 提交于 2019-12-19 10:35:10
问题 What is the difference between JSF Custom Components and Facelets Composite Components? 回答1: JSF custom components are Java classes which extend UIComponent. Facelets composite components are XHTML files which use http://java.sun.com/jsf/composite namespace. See also: When to use <ui:include>, tag files, composite components and/or custom components? 来源: https://stackoverflow.com/questions/5704620/what-is-the-difference-between-custom-components-and-composite-components