2 Replies Latest reply on Jan 10, 2013 8:04 AM by sunfire

    Received 'error@malformedXML' event from <input

    sunfire

      I am currently porting a Seam 2.2 application to Seam 2.3 and during this process I also would like to upgrade Richfaces from 3.3.3 to 4.2.2. Now I have an issue that AJAX validation is not working anymore. At least the returned XML seems to be broken.

       

      edit.xhtml decorator snippet

      <ui:composition  xmlns="http://www.w3.org/1999/xhtml"
                       xmlns:ui="http://java.sun.com/jsf/facelets"
                       xmlns:h="http://java.sun.com/jsf/html"
                       xmlns:f="http://java.sun.com/jsf/core"
                       xmlns:s="http://jboss.org/schema/seam/taglib">
      
          <div class="entry">
              <s:label id="inputLabel" styleClass="label #{invalid?'errors':''}">
                  <ui:insert name="label"/>
                  <s:span id="RequiredStyle" styleClass="required" rendered="#{required}">*</s:span>
              </s:label>
              <span class="input #{invalid?'errors':''}">
                  <s:validateAll id="ValidateAll">
                      <ui:insert/>
                  </s:validateAll>
              </span>
              <s:message id="message" styleClass="error errors" globalOnly="true"/>
          </div>
      
      </ui:composition>
      

       

       

      jsf snippet

               <s:decorate id="web8Decoration" template="edit.xhtml" rendered="#{webcollabCustomerHome.managed}">
                   <ui:define name="label">Web 8</ui:define>
                   <h:inputText id="web8" 
                              size="2"
                         maxlength="3"
                             value="#{webcollabCustomerHome.instance.web8}"
                           required="true">
                        <a4j:ajax event="blur" render="web8Decoration" bypassUpdates="true" execute="@this"/>
                    </h:inputText>
                </s:decorate>
      

       

      Now when I update the value of the input field I get this in the AJAX log:

       

      debug[22:39:22.400]: New request added to queue. Queue requestGroupingId changed to ticket:web8Decoration:web8
      debug[22:39:22.401]: Queue will wait 0ms before submit
      debug[22:39:22.402]: richfaces.queue: will submit request NOW
      info [22:39:22.404]: Received 'begin' event from <input id=ticket:web8Decoration:web8 ...>
      info [22:39:22.485]: Received 'beforedomupdate' event from <input id=ticket:web8Decoration:web8 ...>
      debug[22:39:22.487]: Server returned responseText: <?xml version='1.0' encoding='UTF-8'?> <partial-response><changes><update id="ticket:web8Decoration"><![CDATA[  <div class="entry"><label id="ticket:web8Decoration:inputLabel" for="ticket:web8Decoration:web8" class="label errors"> Web 8<span id="ticket:web8Decoration:RequiredStyle" class="required">*</span></label> <span class="input errors"><input id="ticket:web8Decoration:web8" type="text" name="ticket:web8Decoration:web8" value="-1" maxlength="3" size="2" onblur="RichFaces.ajax(this,event,{&quot;parameters&quot;:{&quot;javax.faces.behavior.event&quot;:&quot;blur&quot;,&quot;org.richfaces.ajax.component&quot;:&quot;ticket:web8Decoration:web8&quot;} ,&quot;sourceId&quot;:this} )" /> </span><span id="ticket:web8Decoration:message" class="error errors">must be greater than or equal to 0</span> </div>]]></update><update id="javax.faces.ViewState"><![CDATA[-7210343971414420562:-7405273376949774702]]></update></changes></partial-response>
      info [22:39:22.490]: Listing content of response changes element:
      Element update for id=ticket:web8Decoration
      <update id="ticket:web8Decoration"><![CDATA[  <div class="entry"><label id="ticket:web8Decoration:inputLabel" for="ticket:web8Decoration:web8" class="label errors"> Web 8<span id="ticket:web8Decoration:RequiredStyle" class="required">*</span></label> <span class="input errors"><input id="ticket:web8Decoration:web8" type="text" name="ticket:web8Decoration:web8" value="-1" maxlength="3" size="2" onblur="RichFaces.ajax(this,event,{&quot;parameters&quot;:{&quot;javax.faces.behavior.event&quot;:&quot;blur&quot;,&quot;org.richfaces.ajax.component&quot;:&quot;ticket:web8Decoration:web8&quot;} ,&quot;sourceId&quot;:this} )" /> </span><span id="ticket:web8Decoration:message" class="error errors">must be greater than or equal to 0</span> </div>]]></update>
      Element update for id=javax.faces.ViewState
      <update id="javax.faces.ViewState"><![CDATA[-7210343971414420562:-7405273376949774702]]></update>
      
      debug[22:39:22.492]: richfaces.queue: ajax submit error
      debug[22:39:22.493]: richfaces.queue: Nothing to submit
      error[22:39:22.494]: Received 'error@malformedXML' event from <input id=ticket:web8Decoration:web8 ...>
      error[22:39:22.495]: [200] undefined: undefined
      

       

      Any idea what would be causing this? It worked quite well in 3.3.3.

       

      Thanks, Thorsten

        • 1. Re: Received 'error@malformedXML' event from <input
          fjrodriguezh

          Hello Thorsten,

           

              I supouse this answer is too late to be useful, but is today when I found the same problem...

           

              You are facing with this Seam 2.3.0.Final bug (that has been resolved in Seam 2.3.1.CR1). The problem is s:decorate's 'enclosed' attribute default value. It must be 'true' but, due to this bug, it is set to 'false' by default. You must set it to 'true' explicitly in your code:

           

          <s:decorate enclose="true" id="web8Decoration" template="edit.xhtml" rendered="#{webcollabCustomerHome.managed}">

               <ui:define name="label">Web 8</ui:define>

               <h:inputText id="web8"
                    size="2"
                    maxlength="3"
                    value="#{webcollabCustomerHome.instance.web8}"
                    required="true">

                    <a4j:ajax event="blur" render="web8Decoration" bypassUpdates="true" execute="@this"/>

               </h:inputText>

          </s:decorate>

           


          Best Regards.

          FJR.

          • 2. Re: Received 'error@malformedXML' event from <input
            sunfire

            Yes it is indeed to late for the answer but I appreciate that it was answered anyways.

             

            Thanks