2 Replies Latest reply on Oct 8, 2011 7:37 AM by healeyb

    RF 4 a4j:ajax not firing on CDI bean?

    kwutzke

      Hello,

       

      I have a CDI filter bean:

       

      {code}@Named

      @RequestScoped

      public class ProjectListFilter

      {

          private String shorthandSearchInput = "";   

         

          public void setShorthandSearchInput(String shorthandSearchInput)

          {

              this.shorthandSearchInput = shorthandSearchInput;

          }

       

          public String getShorthandSearchInput()

          {

              return shorthandSearchInput;

          }   

      }{code}

       

      The I have a rich:dataTable with a column in which I'd like to filter shorthands (name abbreviations):

       

      {code}

      <rich:column filterExpression="#{fn:containsIgnoreCase(pkurz.prjLeiterKurz, projectListFilter.shorthandSearchInput)}" filterEvent="onkeyup">

        <f:facet name="header">

          <h:panelGroup>

            <h:outputText value="Projektleiter" />

            <br />

            <h:inputText value="#{projectListFilter.shorthandSearchInput}" id="shorthand-input">

              <f:ajax event="keyup" render="project-list project-list-ds" oncomplete="setCaretToEnd(event);" />

            </h:inputText>

          </h:panelGroup>

        </f:facet>

        <h:outputText value="#{pkurz.prjLeiterKurz}" />

      </rich:column>

      {code}

       

      The interesting part is the line f:ajax. I currently use that as a4j:ajax doesn't seem to be doing anything at all. Is this a known issue? I can't see anything that could be wrong.

       

      Note, f:ajax doesn't have the oncomplete attribute, so the JS is never called by f:ajax, which would only be called by a4j:ajax if it would fire.

       

      Are there any known issues for why f:ajax basically works and why a4j:ajax doesn't fire? I'm using RF 4.0.0 Final...

       

      Thanks

      Karsten

        • 1. Re: RF 4 a4j:ajax not firing on CDI bean?
          mp911de

          Hi Karsten,

          ther is a easy way to check, whether your f:ajax is fired: Just remove the render-Tag and put a alert('') into your oncomplete.

          As soon your bean is within some context (app/session/request) it will be found by the JSF framework. Have you tried to debug your code, setting breakpoints to your constructor and the setter to check, whether input is passed to the bean?

           

          Best regards,

          Mark

          • 2. Re: RF 4 a4j:ajax not firing on CDI bean?
            healeyb

            In google chrome you could start the javascript console with CTRL+SHIFT+J which provides helpful feedback,

            or F12 (Scripts/Console) in IE.

             

            I don't think you'll get far with request scoped when using ajax, there is some discussion  here:

            http://community.jboss.org/message/591512#591512 thay me be of interest.