title: JSF2 updating composite elements using ajax
body: <p>There's an input element and I want to update it once the user enters something in there.</p>
  
  <p>input element:</p>
  
  <pre><code>&lt;h:form id="form"&gt;
      &lt;h:inputText value="#{message.message}"&gt; 
          &lt;f:ajax event="keyup" render="form:compElem"/&gt; 
      &lt;/h:inputText&gt; 
      &lt;compositeOutputComponents:test2 id="compElem" message="#{message.message}"/&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p>and this is how my composite element looks like:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;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"&gt;
    &lt;h:head&gt;
    &lt;/h:head&gt;
      &lt;h:body&gt;
              &lt;fieldset&gt;
                  &lt;composite:interface&gt;
                      &lt;composite:attribute name="id"/&gt;
                      &lt;composite:attribute name="message" required="true"/&gt;
                  &lt;/composite:interface&gt;
                  &lt;composite:implementation&gt;
                      &lt;span id="#{cc.attrs.id}"&gt;
                          &lt;h:outputText value="#{cc.attrs.message}"/&gt;
                      &lt;/span&gt;
                  &lt;/composite:implementation&gt;
              &lt;/fieldset&gt;
      &lt;/h:body&gt;
  </code></pre>
  
  <p></p>
  
  <p>I tried to pass id to the composite element as Balus in <a href="https://stackoverflow.com/questions/11690635/jsf-updating-composite-component-primefaces">JSF Updating Composite Component (Primefaces)</a> 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.</p>