1 Reply Latest reply on Jun 15, 2009 9:04 AM by Matthew Pickell

    Richfaces 3.1.6 - Using HtmlAjaxSupport inside the bean

    Mohammad Abdo Newbie

      My screen generated dynamically contains two combo boxes "Country" and "City". Once you select a country the City combo box should change to show only the cities inside the chosen country.

      I have to use Richfaces 3.1.6 (JSF 1.1) because I have OC4J.

      The following block from my web page:

       <a4j:form ajaxSubmit="true" >
       <h:panelGrid binding="#{MyBean.htmlPanelGrid}" />

      The following my bean code:
       public class MyBean {
       private HtmlPanelGrid htmlPanelGrid;
       private HtmlSelectOneMenu country;
       private HtmlSelectOneMenu city;
       // Normal setter/getter
       // Constructor
       public MyBean() {
       htmlPanelGrid = new HtmlPanelGrid();
       country = new HtmlSelectOneMenu();
       country.getChildren().add(createSelectItem("Jordan", "Jordan"));
       country.getChildren().add(createSelectItem("Egypt", "Egypt"));
       city = new HtmlSelectOneMenu();
       city.getChildren().add(createSelectItem("Amman", "Amman"));
       city.getChildren().add(createSelectItem("Cairo", "Cairo"));
       HtmlAjaxSupport htmlAjaxSupport = new HtmlAjaxSupport();
       ("#MyBean.loadCombo}", null));
       country.getFacets().put("ajaxSupport", htmlAjaxSupport);
      public void loadCombo() {
       System.out.println("i am working...");

      There is no errors, but the loadCombo() method is not called by the AjaxSupport?