composite-component

How not to set an attribute of a component inside a composite component if it is empty?

五迷三道 提交于 2019-12-01 11:27:30
I have a h:graphicImage in a composite component like this: <composite:interface> <composite:attribute name="name" required="true" type="java.lang.String" /> <composite:attribute name="alt" required="false" type="java.lang.String" /> <composite:attribute name="height" required="false" type="java.lang.String" /> <composite:attribute name="width" required="false" type="java.lang.String" /> </composite:interface> <composite:implementation> <h:graphicImage url="something-common#{cc.attrs.name}" alt="#{cc.attrs.alt}" height="#{cc.attrs.height}" width="#{cc.attrs.width}" /> </composite

JSF cross field validation via postValidate without looking up components by name in backing bean

你。 提交于 2019-12-01 11:13:09
I'm building a login form composite component. The page that uses it will pass an event handler that will validate the username and password. Usually (not using composite components) when we perform cross field validation via postValidate , the event handler has to lookup the fields' components by name. It would be preferable for the validator not to do this, because these are inner details of the component that should be abstracted. Any idea how I might get the converted values of the username and password fields in a postValidate handler without knowing the inner details of the composite

What is the difference between Custom Components and Composite Components?

帅比萌擦擦* 提交于 2019-12-01 10:57:34
What is the difference between JSF Custom Components and Facelets Composite Components? BalusC 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

JSF define custom namespace for component declaration

两盒软妹~` 提交于 2019-12-01 10:09:43
问题 when you use a component from extarnal libraries (or custom component) in JSF page you add the xmlns declaration, for example: xmlns:util="http://java.sun.com/jsf/composite/component/util I would like to know what I have to do to use a private address in the Namaspace like this below: xmlns:p=" http://primefaces.prime.com.tr /ui" It is something related to packages? Or it depends from the name of the .JAR that contains the components? Thank you! 回答1: For Facelets this is definied in .taglib

How to stop recursive composite component from including itself recursively

纵然是瞬间 提交于 2019-12-01 09:58:39
问题 Is it possible to have a JSF component that has ui:repeat and inside the repeat call the same component? It's because I'm building tree of question: <cc:interface> <cc:attribute name="questions" required="true" /> <cc:attribute name="renderQuestions" required="true" default="true" /> </cc:interface> <cc:implementation> <c:if test="#{cc.attrs.renderQuestions}"> <ui:repeat value="#{cc.attrs.questions}" var="q"> <p:panelGrid columns="2"> <h:outputLabel value="#{q.question}"></h:outputLabel> <p

javax.el.PropertyNotFoundException with CompositeComponent?

穿精又带淫゛_ 提交于 2019-12-01 09:43:10
I'm currently trying to build a composite component, and this is how i make use of my component : Include it with xmlns:albert="http://java.sun.com/jsf/composite/albert" And here's the usage example <albert:infoButton infoId="infoSingleRecord" params="transDateFrom transDateTo" mappingMethod="#{tBrowseBean_ConfirmedRPB.mapSendInfoSingleRecord}" /> And this is the component which is put in resources/albert/infoButton.xhtml <?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=

h:dataTable composite component, cc.attrs.var, IllegalArgumentException

一个人想着一个人 提交于 2019-12-01 08:14:55
I'm trying to create my own dataTable like the primefaces one. The problem is that cc.attrs.var when used throws a IllegalArgumentException. So I'm wondering how I can have the var attribute like Primefaces. <cc:interface> <cc:attribute name="value"/> <cc:attribute name="var"/> <cc:attribute name="styleClass"/> </cc:interface> <cc:implementation> <div>Previous</div> <div>Next</div> <h:dataTable value="#{cc.attrs.value}" var="#{cc.attrs.var}" styleClass="#{cc.attrs.styleClass}"> <ui:insert/> </h:dataTable> </cc:implementation> BalusC As per the UIData#setValueExpression() javadoc, it's not

How not to set an attribute of a component inside a composite component if it is empty?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 07:39:38
问题 I have a h:graphicImage in a composite component like this: <composite:interface> <composite:attribute name="name" required="true" type="java.lang.String" /> <composite:attribute name="alt" required="false" type="java.lang.String" /> <composite:attribute name="height" required="false" type="java.lang.String" /> <composite:attribute name="width" required="false" type="java.lang.String" /> </composite:interface> <composite:implementation> <h:graphicImage url="something-common#{cc.attrs.name}"

Composite component required attribute throws exception in Mojarra 2.0.3

三世轮回 提交于 2019-12-01 07:36:50
I've been playing around with JSF 2.0 composite components but I'm a bit confused as to what the require attribute in the composite:attribute tag is meant to do. The documentation says that the required attribute is true if the page author must supply a value for this attribute. I've interpreted that as meaning that a value must be supplied for all composite:attributes that have required=true . I also assumed that an empty string is a valid value. And this is how it worked in Mojarra 2.0.2. Using this simple managed bean: @ManagedBean(name = "simpleMB") @ViewScoped public class

Specifying different error messages for different composite components

霸气de小男生 提交于 2019-12-01 07:24:48
问题 Is there a way to have REQUIRED messages for different kinds of composite components? I'd like to be able to say something like the following in a message bundle javax.faces.component.UIInput.REQUIRED=Please enter a value for {0} com.anon.sandbox.jsf.component.NameField.REQUIRED=ENTER A {} OR DIE com.anon.sandbox.jsf.component.EmailField.REQUIRED=You forgot to enter a {0} address I could do this by implementing custom validators for each kind of input field, but given that the only behaviour