composite-component

f:param to composite components

元气小坏坏 提交于 2019-12-11 03:48:39
问题 In JSF2.1 composite component if we try to pass f:param to a composite component (command button) and recieve in the component as editableValueHolder ,It doesn't seems to be working, Any ideas? <mycomp id="button" outcome="newpage" > <f:param name="foo" outcome="bar" for="button"/> </mycomp> compositeComponent.... <cc:interface> <cc:attribute name="action" targets="commandLink" required="true" /> </cc:interface> <cc:implementation> <h:commandLink id="commandLink" action="#{cc.attrs.action}">

Execute a script on f:ajax “success” event only when validation has not failed

流过昼夜 提交于 2019-12-11 03:48:26
问题 I have created a composite component that extends the command button and add some ajax functions (onBegin, onComplete and onSuccess), but I have some problems that I couldnt solve: When I click on the button and a validation error occur, in success event function is passed #{facesContext.validationFailed} = false instead of true even thought the form is render again; (html is render before a success event called, right?) <html xmlns="http://www.w3.org/1999/xhtml" xmlns:cc="http://java.sun.com

JSF 2 composite:actionSource exposing commandButtons in ui:repeat

拥有回忆 提交于 2019-12-11 03:36:11
问题 In my composite component, I have a ui:repeat that has, among other static things, a command button, like this: <ui:repeat var="article" value="#{cc.attrs.articleList}"&gt <strong>Aricle: #{article}</strong> <h:commandButton id="addToFavs" value="Subscribe" binding="..." type="..." > <f:setPropertyActionListener value="#{article}" target="..." /> </h:commandButton > </ui:repeat> Now, I'd like to expose this event in the composite interface, so that in my page, I may attach event listeners and

setPropertyActionListeners to composite component

故事扮演 提交于 2019-12-11 02:56:07
问题 I need to create composite component containing two h:commandLinks. And i want to pass f:setPropertyActionListeners from the client-code to be applied to both two commandLinks. Is this ever possible? I tried to use cc:insertChildren, but appropriate setters are not being fired. <my:operationLink action="#{cc.attrs.bean.myAction}"> <f:setPropertyActionListener for="<!-- whats here? -->" value="#{cc.attrs.someAttrOne}" target="#{cc.attrs.bean.someAttrTargetOne}"/> <f:setPropertyActionListener

How to create a composite component with dynamic attributes?

北慕城南 提交于 2019-12-11 02:45:20
问题 I have this composite component: <cc:interface> <cc:attribute name="image_1" /> <cc:attribute name="image_2" /> <cc:attribute name="image_3" /> </cc:interface> <cc:implementation> <div id="slider-container"> <div id="slider-small"> <h:graphicImage library="images" name="#{cc.attrs.image_1}" /> <h:graphicImage library="images" name="#{cc.attrs.image_2}" /> <h:graphicImage library="images" name="#{cc.attrs.image_3}" /> </div> </div> </cc:implementation> I use it in this way : <cs:small_slider

Keeping @ViewScoped property states in composite component backings

人走茶凉 提交于 2019-12-10 20:56:34
问题 This question is related with my previous one about initializing composite components. Providing I've got a homegrown composite component and a @ViewScoped managed bean, I want certain properties of the managed bean to be reflected in the component. The transition of the property value to the component is done by a composite attribute . That's the code I've got right now, consisting in a @ManagedBean which defines a random row number to be rendered at the component. The component generates a

How to reference component inside a composite component when using a converter

青春壹個敷衍的年華 提交于 2019-12-10 20:23:43
问题 I have a composite component that mainly consists of a selectManyCheckbox component. As it should be designed in a generic way I pass in selectItems, ajax handling etc. from the calling level using <composite:insertChildren/> This works quite well for most of the stuff. Now I need to use this composite component with a converter. As the converter (a kind of Omnifaces' ListConverter) is not needed all the time (sometimes I want to have the value-binding of concrete entities that back the

FacesConverter forClass don't work with Composite Componet

那年仲夏 提交于 2019-12-10 17:50:00
问题 I've got a simple composite component which has to render a inputText. When a put the value and press commandButton the follow exception is throw: java.lang.IllegalArgumentException: Cannot convert 1 of type class java.lang.String to class sample.entity.Product When i use h:inputText instead d:myInputText it's work fine. Is possible use a FacesConverter and attribute forClass for composite component? I do not like to use converter attribute or converterId of tag f:converter. Anybody help me?

How to access Composite Component attribute values in the backing UIComponent?

落花浮王杯 提交于 2019-12-10 16:09:00
问题 We can access the Composite Component attribute values (defiled in the interface section), in the implimentation like #{cc.attrs.attributeName} How can we access this value in the backing component? 回答1: It's just available inside any of the methods by the inherited getAttributes() method which returns a Map<String, Object> with the attribute name as map key and attribute value as map value. Bar bar = (Bar) getAttributes().get("bar"); // ... 来源: https://stackoverflow.com/questions/6888808/how

action and actionListener for p:commandButton in composite component

为君一笑 提交于 2019-12-10 15:57:44
问题 I am making composite component where i have commandButton. But it doesn't work. Usage: <wk:commandButton value="Non-Ajax actionListener" actionListener="#{ioBean.saveListener}" /> Code of component: commandButton.xhtml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http:/