composite-component

How can I cache data inside a composite component?

爱⌒轻易说出口 提交于 2019-12-13 16:23:30
问题 I've been working with this dynamic list component: How to implement a dynamic list with a JSF 2.0 Composite Component? One of the things I'd like to do is cache the original value of "list" so that, when a user adds or removes something from this list...I know which ones were added/removed so that I can do something different with them. For example, a "removed" item would simply have a strikethrough instead. Or, an "added" item would have a different background to show that it was recently

Can I call methods on beans in composite components?

天大地大妈咪最大 提交于 2019-12-13 14:05:22
问题 I want to write a more or less gemeric component, where i hand in a controller bean and the componend should display some CRUD buttons. Following composite component: <composite:interface> <composite:attribute name="controller" /> <composite:attribute name="object" /> </composite:interface> <composite:implementation> <h:panelGrid columns="3" columnClasses="celltop"> <h:commandButton id="save" value="#{msg.saveButtonLabel}" action="#{cc.attrs.controller.save}" /> <h:commandButton id="delete"

Jsf composite components attribute doesn't work

浪尽此生 提交于 2019-12-13 13:43:15
问题 I am trying to create composite components. I defined 4 attributes in composite:interface section. Here is code <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:composite="http://java.sun.com/jsf/composite"> <composite:interface > <composite:attribute name="id" /> <composite:attribute name="maxlength" /> <composite:attribute name=

JSF composite component value and <c:if> [duplicate]

天大地大妈咪最大 提交于 2019-12-13 07:06:11
问题 This question already has answers here : JSTL in JSF2 Facelets… makes sense? (3 answers) Closed 4 years ago . I have the following: <c:set var="myMode" value="#{component.parent.attributes['xyz-mode']}"/> where "xyz-mode" is from another composite component... when I print its value using this: <p:outputLabel value="#{myMode}" /> It prints it correctly, suppose the value is 3 But..in the same page, when I use c:if or c:when.. it does not evaluate the value correctly: <c:choose> <c:when test="

Problems with actionListener of composite component

风流意气都作罢 提交于 2019-12-13 05:19:22
问题 I am goin to explain a problem that I have when I use one composite component inside a template. Imagine one view like this, that work with a generic managed bean with view scope. I pass it to the template as a parameter. <?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="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com

JSF2 Composite component link using ajax

懵懂的女人 提交于 2019-12-13 02:27:53
问题 Here is my (simplified) issue : I've got a page that is using 2 composite components of mine : - CCSelection - CCDisplay In CCSelection, I have a list of values, each one has got a h:commandLink onto. When clicking on a link, the CCDiaplay component is refreshed using the selected value. To do this, CCSelection exposes a method attribute that is directly linked on each h:commandLink. The value is given to the method using f:attribute. In the page backing bean, I've got a method (that is given

encodeAll() not called on a composite component when rendered attribute is wrapped

白昼怎懂夜的黑 提交于 2019-12-13 01:50:50
问题 When I do: <h:form> <ui:repeat ...> <ui:fragment rendered="#{xyz.type eq 1}" <h:inputText value="#{xyz}"/> </ui:frament> <ui:fragment rendered="#{xyz.type eq 2}" <my:component value="#{xyz}"/> </ui:frament> <ui:repeat /> </h:form> encodeAll() doesen't get called on my:component and subsequently the existing values are not shown. If I do the following though <ui:repeat ...> <ui:fragment rendered="#{xyz.type eq 1}" <h:inputText value="#{xyz}"/> </ui:frament> <ui:fragment rendered="#{xyz.type eq

How can I create a JSF composite component that allows me to read/write to the attributes?

馋奶兔 提交于 2019-12-13 01:42:39
问题 I'm trying to create a composite component which allows a user to toggle between a selectOneMenu and selectManyListbox. I want the toggle to be bindable to a boolean value and the selectOneMenu/selectManyListbox bindable to a list of objects in the view-scoped backing bean of the page. I'm able to create a composite component that can read the variables easily enough. I just get the attributes within the bound @FacesComponent object via getAttributes() . How do I go about making those

Error trying to add composite component programmatically (“no tag was defined for name”)

北战南征 提交于 2019-12-12 23:21:46
问题 I'm facing one of those errors that you're almost sure that you're not doing anything wrong, but the error simply won't go away, no mather what you do. I have this composite component: inputMask.xhtml <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:composite="http://xmlns.jcp.org/jsf/composite" xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"> <composite:interface> <composite:attribute name="value" />

Composite component validation in JSF 2.0

左心房为你撑大大i 提交于 2019-12-12 20:02:28
问题 I have composite component in JSF 2.0 <composite:interface> <composite:attribute name="inputId"/> <composite:attribute name="labelValue"/> <composite:attribute name="inputValue" /> <composite:attribute name="required" /> <composite:attribute name="requiredMessage" /> </composite:interface> <composite:implementation> <div class="control-group"> <h:outputLabel for="#{cc.attrs.inputId}" value="#{cc.attrs.labelValue}" class="control-label" /> <div class="controls"> <h:inputText id="#{cc.attrs