1 Reply Latest reply on Mar 20, 2008 11:57 AM by Ben Maisano

    A4j:support actionExpression not calling server

    Ben Maisano Newbie

      I'm trying to add Ajax4jsf to an existing JSF application, where it did not exist anywhere before. I've read the tutorial and already done the following:
      Downloaded the Ajax4jsf-1.1.1 jar and put it in my WEB-INF/lib directory.
      Added the following to my web.xml file:
      <!-- Added for Ajax4jsf -->

      <display-name>Ajax4jsf Filter</display-name>

      <servlet-name>Faces Servlet</servlet-name>


      **I think only the filter part is actually necessary to be added, but I wasn't positive. I then added the tag lib import to one of my existing jsf pages:
      <%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>

      I next tried to add an ajax support tag to an existing selectOnePullDown

      <h:selectOneMenu styleClass="employeeStyle" id="employeeList" tabindex="1" value="#{EmployeeMB.individualId}">
      <f:selectItem itemValue="" itemLabel="" />
      <f:selectItems value="#{CaseMB.employeeList}" />
      <a4j:support event="onchange" onsubmit="alert('a4j called');"
      actionExpression="#{ConditionAction.retriveMemberInfo}" reRender="memberList" />

      As you can see above, I've added the a4j:support tag and the actionExpression should call the retriveMemberInfo method on the ConditionAction Managed bean ( which is setup in the faces-config.xml ). I added a sanity check in the onsubmit attribute, and that pop up alert does come up. However, my problem is the server managed bean method never gets called, and I done see my memberList component reRendered. The memberList is another selectOneMenu item. I put a braek point in the retriveMemberInfo, but still see nothing getting called, and no error logs from console. I do see this message when my app starts up in console output:
      com.ibm.ws.jsf.configuration.FacesConfigParser parseShared FacesConfigParser.parseShared(): unable to locate : [facet-name]
      com.ibm.ws.jsf.configuration.FacesConfigParser parseShared FacesConfigParser.parseShared(): unable to locate : [facet]

      Googling for this msg I didn't find much, only something about two faces-config.xml files and a class loader parent last thing. I did notice the Ajax4jsf.jar has a faces-config.xml file referenced in its META-INF/ path. Any help with this is greatly appreciated, thanks.

        • 1. Re: A4j:support actionExpression not calling server
          Ben Maisano Newbie

          As a follow up, I converted the selectOneMenu from a valueChangeEvent as it was this:

          The method takes a "ValueChangeEvent" which I think may be the problem. What attributes for an a4j:support tag should I use that work with a ValueChangeEvent in faces. I see the actionListener event attribute mentioned in the JBos devGuide chapter 6, which says it takes an ActionEvent. Is there a way to do this in Ajas4jsf ?