0 Replies Latest reply on Jul 31, 2008 4:35 PM by Edwin van der Elst

    Adding a4jsupport to multiple components

    Edwin van der Elst Newbie

      Hi, (sorry for crossposting, I posted in Richfaces forum, should have used this forum)

      I am trying to create a component to add a onchange listener (a4jsupport) to all UIInput components on a page.
      This is comparable to the 'validateAll' tag in Seam.
      Like this:

       <t:supportAll event='onchange' action="#{myBean.action}">
       <h:inputText ....>
       <h:inputText ....>
       </t:supportAll>
      

      I tried subclassing HtmlAjaxSupport, but this stops the children from rendering.

      In my component, I add a HtmlAjaxSupport element to all subclasses of UIInput:
       HtmlAjaxSupport support = new HtmlAjaxSupport();
       support.setEvent("onchange");
       support.setReRender(rerender);
       for (ActionListener l : this.actionListeners) {
       support.addActionListener(l);
       }
       c.getFacets().put("a4jsupport", support);
      


      I see the onChange in the HTML in the browser, but I never get an event on the server....

      Which component should I subclass for this? (I only want to add a4jsupport, not render any output for the component itself)
      Is it correct to add the HtmlAjaxSupport from the 'encodeChildren' method, or do I need to do this at some other time?

      Edwin