There's an input element and I want to update it once the user enters something in there.
input element:
<h:form id="form">
<h:inputText value="#{message.message}">
<f:ajax event="keyup" render="form:compElem"/>
</h:inputText>
<compositeOutputComponents:test2 id="compElem" message="#{message.message}"/>
</h:form>
and this is how my composite element looks like:
<?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:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite">
<h:head>
</h:head>
<h:body>
<fieldset>
<composite:interface>
<composite:attribute name="id"/>
<composite:attribute name="message" required="true"/>
</composite:interface>
<composite:implementation>
<span id="#{cc.attrs.id}">
<h:outputText value="#{cc.attrs.message}"/>
</span>
</composite:implementation>
</fieldset>
</h:body>
I tried to pass id to the composite element as Balus in JSF Updating Composite Component (Primefaces) suggested (I dont use primefaces), but still page yields an error : "malformedXML: During update: form:compElem not found". When i use non composite element everything works fine.