2 Replies Latest reply on Apr 30, 2010 2:25 AM by xck3001

    Textarea and textfield allowing no spaces

    xck3001

      Hi,

       

      I have a form which is submitted using a4j:commandButton. The form is included in my main page using ui:include, here is a snippet of the form:

       

       

      <h:form id="form_#{paramContactArea}">
                      <fieldset>
                              <h:outputLabel for="contactFormText">
                                      <h:outputText value="#{i18n['yourmessage']}"/>
                              </h:outputLabel>
                              <h:inputTextarea id="contactFormText" styleClass="d_frm_txt" rows="7" cols="100" value="#{contactBean.message.message}">
                                      <rich:beanValidator summary="#{i18n['message']}"/>
                              </h:inputTextarea>
                              <rich:message for="contactFormText" showSummary="true" showDetail="false" />
                      </fieldset>
          ...
      

       

      The h:inputTextarea has a serious problem: The user cannot enter a space (" ") into it. It just won't insert anything when the user presses the space bar key. Every other character works, even line breaks.

       

      It seems some Javascript prevents the space to appear there. When I turn on "Hold on next JS execution" in Firebug, I see that pressing the space bar key leads to some call in the ajax4jsf file framework.pack.js.jsf, so I think it is filtered out there.

       

      Has anyone an explaination why this happenes? I see no reason for it... There is no rich:key registered.

       

      Thanks in advance!

       

      Matthias

        • 1. Re: Textarea and textfield allowing no spaces
          xck3001

          Did some further tests.

          • Removing the rich:beanValidator doesn't change anything
          • The same effect occurs inside any standard HTML <input type="text"/> on this page
          • The JavaScript Console doesn't look any error - looks good

           

          Very weird effect... I will try to reduce the page step-by-step to identify which causes this. On other pages of our application, we don't have this behaviour.

          • 2. Re: Textarea and textfield allowing no spaces
            xck3001

            Ok, nevermind, I found it.

            We had a gallery JS (gallerific) on the same page which caught the spaces. The reason why I got into the ajax4jsf JS when hitting the space bar seems to be that RF catches the keydown, but the propagates it. The actual wrong behaviour then happened in the gallery script.

             

            Sorry for the confusion!