1 Reply Latest reply on Oct 7, 2010 3:22 AM by ilya_shaikovsky

    Can't define a event and bind an <a4j:support/> on this event at the same time

    romaintaz

      Hello all,

       

      I am using Richfaces 3.3.2 with JSF 1.2, and I have a question regarding the usage of <a4j:support> component.

       

      Let's consider this simple code:

       

          <h:inputText id="myInput" onchange="alert('foobar');">
              <a4j:support event="onchange" actionListener="#{myBean.doSomething}"/>
          </h:inputText>

       

      This will generate the following HTML code:

       

          <input id="myForm:myInput" type="text" name="myForm:myInput" onchange="alert('foobar');" />

       

      As you can see, the Ajax call is not binded to the onchange event of the <h:inputText>.

       

      My question is to know if this behavior is normal, or is it a bug of the <a4j:support> component...

       

       

      Of course, I can avoid this problem with the following code:

       

      <h:inputText id="myInput">
          <a4j:support onsubmit="alert('foobar');" event="onchange" actionListener="#{myBean.doSomething}"/>
      </h:inputText>

       

      Regards.