composite-component

How to pass the node value as the attribute in Composite Component in JSF 2.0

家住魔仙堡 提交于 2019-12-02 06:14:14
问题 I am developing a JSF 2.0 composite component. I am trying to create a box component to which my required HTML will be set as attribute. Some thing like.. <composite:interface> <composite:attribute name="value" /> </composite:interface> <composite:implementation> <table cellpadding="0" cellspacing="0" border="1" width="100%"> <tr> <td></td> <td>#{cc.attrs.value}</td> <td></td> </tr> </table> </composite:implementation> When I want to use this component and pass the required HTML to the

#{cc.clientId} evaluated in wrong composite after upgrading to JSF 2.2

≡放荡痞女 提交于 2019-12-02 05:34:45
问题 I have a tag library which was written in JSF 2.0 + PrimeFaces 3.4, now i am trying to update to JSF 2.2 and PrimeFaces 4.0. But i realized that the value of attributes passed to component evaluated in composite component and it leads to wrong id for rendering. enum.xhtml (composite component) <cc:interface> <cc:attribute name="render" default="@this"/> ..... </cc:interface> <cc:implementation> <h:selectOneMenu ......../> <p:ajax update="#{cc.attrs.render}" process="#{cc.attrs.execute}" /> <

Obtaining the clientId of the parent of a JSF2 composite component

こ雲淡風輕ζ 提交于 2019-12-02 04:42:20
I've got the following code: <h:dataTable id="dt" value="#{somelist}" var="entry"> <h:column> #{entry.title} </h:column> <h:column> <h:commandLink id="lnk"> <mycomp:doSomething id="dummy" /> </h:commandLink> </h:column> </h:dataTable> My composite component (mycomp:doSomething) looks like this: <?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:composite="http://java.sun.com/jsf/composite">

#{cc.clientId} evaluated in wrong composite after upgrading to JSF 2.2

血红的双手。 提交于 2019-12-02 02:04:37
I have a tag library which was written in JSF 2.0 + PrimeFaces 3.4, now i am trying to update to JSF 2.2 and PrimeFaces 4.0. But i realized that the value of attributes passed to component evaluated in composite component and it leads to wrong id for rendering. enum.xhtml (composite component) <cc:interface> <cc:attribute name="render" default="@this"/> ..... </cc:interface> <cc:implementation> <h:selectOneMenu ......../> <p:ajax update="#{cc.attrs.render}" process="#{cc.attrs.execute}" /> </cc:implementation> usage : <t:enum id="authenticationSource" value="#{authenticationStrategy}" .....

How to pass the node value as the attribute in Composite Component in JSF 2.0

99封情书 提交于 2019-12-01 23:54:41
I am developing a JSF 2.0 composite component. I am trying to create a box component to which my required HTML will be set as attribute. Some thing like.. <composite:interface> <composite:attribute name="value" /> </composite:interface> <composite:implementation> <table cellpadding="0" cellspacing="0" border="1" width="100%"> <tr> <td></td> <td>#{cc.attrs.value}</td> <td></td> </tr> </table> </composite:implementation> When I want to use this component and pass the required HTML to the attribute "value", like so: <someDir:boxComp>Hello</someDir:boxComp> the "Hello" is not taken as attribute

Inheriting component attributes in a composite component which extends an existing JSF component

安稳与你 提交于 2019-12-01 19:51:09
I wish to extend the following element: <h:commandButton action="#{menuController.xyz}" value="xyz" image="images/buttons/xyz.png" alt="xyz".....[more attributes]..../> to include code to produce a depressed button: <h:commandButton action="#{menuController.xyz}" value="xyz" image="images/buttons/xyz.png" alt="xyz" onmousedown="[some JS here to change image src]" .....[more attributes]..../> I understand the neatest way to do this is with a JSF component? So I created the following: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1

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

白昼怎懂夜的黑 提交于 2019-12-01 19:47:31
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:insert and that worked fine. Question: Why doesn't it work and how should I use the template as an

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

若如初见. 提交于 2019-12-01 16:49:21
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 value</ui:insert> . So I need both insertChildren and childCount which do not seem to work together.

Include a javascript for composite component only once in a page despite of composite components themselves used multiple times

痞子三分冷 提交于 2019-12-01 15:57:33
问题 How do I include a JavaScript code only once for multiple usages of a composite component on a page? Initially I had put I put the JS code inside the cc:implementation tags but that lead to the script being included each time with the components. I want to avoid this condition and include the JavaScript only once even if component has been used multiple times on a page. 回答1: Include the static part of that JS code as a standalone JS file by <h:outputScript> with target="head" . It'll be

How to stop recursive composite component from including itself recursively

三世轮回 提交于 2019-12-01 12:33:11
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:selectBooleanButton onLabel="#{messages['commons.yes']}" offLabel="#{messages['commons.no']}" onIcon="ui