composite-component

Getting JSF-defined component with Javascript

微笑、不失礼 提交于 2019-12-08 04:13:03
问题 I'm creating an interface using JSF, and I'd like the value of one text field to provide the default for a second if the second hasn't yet been set. The crucial code will look something like this: <h:outputScript> function suggestValue2() { var value2 = document.getElementById('value2').value; if (value2 == "") { document.getElementById('value2').value = document.getElementById('value1').value; } } </h:outputScript> <h:inputText id="value1" onblur="suggestValue2();" /> <h:inputText id="value2

Using EL in attribute of composite component

痴心易碎 提交于 2019-12-08 03:52:43
问题 My JSF custom component code: <composite:interface name="translation"> <composite:attribute name="fieldName"/> <composite:attribute name="required" default="true" /> </composite:interface> <composite:implementation> <h:inputText required="#{cc.attrs.required}" requiredMessage="Please enter #{cc.attrs.fieldName} in english"/> </composite:implementation> This works fine if I specify the required attribute as follows: <comp:translation fieldName="myTranslation" required="true" /> But does not

Unable to find matching navigation case from composite component

限于喜欢 提交于 2019-12-08 03:09:56
问题 I have a composite component button and the action is coming from an attribute. <comp:interface> <comp:attribute name="buttonId" required="false"/> <comp:attribute name="action" required="false" method-signature="java.lang.String action()"/> <comp:attribute name="alt"/> <comp:attribute name="value" /> <comp:attribute name="immediate"/> </comp:interface> <comp:implementation> <h:commandButton alt="#{cc.attrs.alt}" action="#{cc.attrs.action}" value="#{cc.attrs.value}" id="#{cc.attrs.buttonId}"

validator method not work in the JSF custom composite components

十年热恋 提交于 2019-12-08 03:02:27
JSF custom composite components input.xhtml <cc:interface> <cc:attribute name="validator"/> </cc:interface> <cc:implementation> <h:inputText validator="#{cc.attrs.validator}"/> </cc:implementation> *.xhtml <l:input value = ... validator="#{testValidator.validator}"/> java code @ManagedBean public class TestValidator { public void validator(FacesContext context, UIComponent component, Object value) throws ValidatorException { System.out.println("Call validator"); } } PropertyNotFoundException: validator="#{testValidator.validator}": The class 'TestValidator' does not have the property

Script is not rendered after postback in a composite component added programmatically

萝らか妹 提交于 2019-12-08 02:06:16
问题 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:attribute name="mask" type="java.lang.String" required="true" /> <composite:attribute name="converterId" type="java.lang.String" default="br

Checkbox inside ui:repeat not refreshed by Ajax

雨燕双飞 提交于 2019-12-08 01:26:17
问题 I work with Mojarra 2.1.3. When the user click on button "refresh don't work", it refresh the content of the ui:repeat.I expect the checkbox to be checked, just as at the initialization. What I've found: If I remove h:head in the facelet "refresh don't work" works... Any idea ? The facelet: <h:head></h:head> <h:body> <h:form id="myForm" > <h:panelGroup id="panelToRefreshOutsideRepeat"> <ui:repeat value="#{sandbox.columns}" var="column"> <h:panelGroup id="panelToRefreshInsideRepeat"> <h2

Getting same instance of `componentType` in composite component on every use

这一生的挚爱 提交于 2019-12-07 18:35:17
问题 Hi Have this Wierd Issue in which I am using a Composite Component which I wrote and I get values from the previous use of the backing bean of the CC (the componentType bean) I don't know how to describe this better than just show the code. I'll try to be brief about it and cut the redundant parts: This is the Composite Component definition: <cc:interface componentType="dynamicFieldGroupList"> <cc:attribute name="coupletClass" /> <cc:attribute name="form" default="@form"/> <cc:attribute name=

How to define the content of repeater inside composite through its interface?

吃可爱长大的小学妹 提交于 2019-12-07 15:37:55
问题 I have a composite component with a ui:repeat and want to define the content of the ui:repeat through the interface of the composite. Following code is working in MyFaces but looks more like a hack since variable name varRepeat must be known outside of composite and it only works if no other childrens are provided that should be rendered somewhere else. View Define content of the ui:repeat <comp:myRepeater value="#{of:createIntegerArray(1,5)}"> <h:outputText id="varComp" value="#{varRepeat}"/

JSF2.0 Composite Component actionListener

主宰稳场 提交于 2019-12-07 04:18:46
问题 I am in need of some assistance in getting my Composite Component to behave. I am still learning the ropes in JSF, so please excuse any ignorance that might be displayed in this post. So, I am working with JSF 2.0 and decided to build a composite component to make this particular code snippet reusable. The component displays everything perfectly, but will not behave at all when trying to add the actionListener. Here is the code for my component <ui:composition xmlns="http://www.w3.org/1999

Sink JSF 2.0 Composite Component Event in Parent Page Backing Bean

流过昼夜 提交于 2019-12-06 16:57:07
问题 I have a conceptual mind-block around the use of a JSF 2.0 composite component within a parent page. I understand how to implement an ActionListener (and others) for a composite component's action but how is this wired-up for the parental page to consume? For example, I want my login composite component to perform authentication and when complete, inform the parent page's backing bean through the an event (ActionListener?) to do some UI initialization work. The key here is the login component