2 Replies Latest reply on Apr 10, 2008 5:17 PM by face4web

    Multiple whitespaces in Ajax4Jsf

    face4web

      Hi all,

      We have a problem with a selectOneMenu in Ajax4JSF.
      In the selectItems we have some values and labels with multiple whitespace chars after each other, without rendering with Ajax4Jsf we had no problems. The first time JSF rendered the page perfect (no Ajax request, value has multiple whitespace chars after each other), when we click a second time on the A4J button to do some action, the values in the selectOneMenu are edited by Ajax4Jsf, the multiple whitespace chars are reduced to 1 character! Now a validation error occurs because the values are not the same anymore...


      Some code:

      <a4j:commandButton value="Add" action="#{pc.doSomething}" reRender="cboId" />
      
      <h:selectOneMenu styleClass="button" value="#{pc.someVar}" id="cboId">
      <f:selectItems value="#{pc.allselecteditems}" />
      </h:selectOneMenu>
      


      The first time, JSF renders this as following HTML code:

      <select>
       <option value="accord">Honda Accord</option>
       <option value="4 runner">Toyota 4 Runner</option>
       <option value="nissan-z">Nissan Z350</option>
      </select>


      After the Ajax request, the value is manipulated to 1 whitespace character:

      <select>
       <option value="accord">Honda Accord</option>
       <option value="4 runner">Toyota 4 Runner</option>
       <option value="nissan-z">Nissan Z350</option>
      </select>


      We are using Facelets 1.1.15, Myfaces 1.1.5, Tomahawk 1.1.6 and Richfaces 3.2.0

      Any idea will be appreciated!

      Regards,
      Dimi