5 Replies Latest reply on Feb 13, 2008 5:35 PM by Fijai Cairo

    <s:conversationPropagation type=

    Fijai Cairo Newbie

      This code worked prior to Seam 2.0.1GA. I've tested various combinations of seam and richfaces versions and 2.0.1 seems to be the culprit.
      With <s:conversationPropagation type="join" />:

      <a4j:commandButton styleClass="btn" id="contactButton#{accountHolder}" oncomplete="UIControl('contactForm', 'contact', 'identification');" reRender="contactBlock#{accountHolder},uiSec" actionListener="#{accountOpen.submitContactInfo}" value="Continue" >
       <a4j:actionparam name="holder" value="getSuffix()" noEscape="true"/>
       <s:conversationPropagation type="join" />
       </a4j:commandButton>
      
      


      Renders the following: Notice that the onclick handler is rendered before the input is rendered and causes a document.getElementById("contactButton1") has no properties javascript error.



      <div id="contactContinueSection1" style="padding: 10px 10px 10px 10px; display: block">
      
      <script language="JavaScript" type="text/javascript">
      //<![CDATA[
      document.getElementById('contactButton1').onclick = new Function("event", "{if (document.getElementById){var form = document.getElementById('contactForm1');var input = document.createElement('input');if (document.all){ input.type = 'hidden';input.name = 'conversationPropagation';input.value = 'join';}else if (document.getElementById) {input.setAttribute('type', 'hidden');input.setAttribute('name', 'conversationPropagation');input.setAttribute('value', 'join');}form.appendChild(input);return true;}}");
      //]]>
      </script>
      
      <input id="contactButton1" name="contactButton1" onclick="A4J.AJAX.Submit('_viewRoot','contactForm1',event,{'parameters':{'holder':getSuffix(),'conversationPropagation':'join','contactButton1':'contactButton1'} ,'actionUrl':'/BaisiPrototype/AE/primary.jspv?javax.portlet.faces.DirectLink=true','oncomplete':function(request,event,data){UIControl('contactForm', 'contact', 'identification');}} );return false;" value="Continue" class="btn" type="button" />
       </div>
      


      Without <s:conversationPropagation type="join" />, the onclick handler is rendered as an attribute of the button as ff:

       <div id="contactContinueSection1" style="padding: 10px 10px 10px 10px; display: block"><input id="contactButton1" name="contactButton1" onclick="A4J.AJAX.Submit('_viewRoot','contactForm1',event,{'parameters':{'holder':getSuffix(),'contactButton1':'contactButton1'} ,'actionUrl':'/BaisiPrototype/AE/primary.jspv?javax.portlet.faces.DirectLink=true','oncomplete':function(request,event,data){UIControl('contactForm', 'contact', 'identification');}} );return false;" value="Continue" class="btn" type="button" />