0 Replies Latest reply on Sep 26, 2008 7:16 AM by Lukasz Grden

    HtmlSelectOneMenu and HtmlAjaxSupport in java code

    Lukasz Grden Newbie

      I'm having some problems with the HtmlSelectOneMenu combined with HtmlAjaxSupport. In my application, I am using method bindings so I need to create and build up the UI Components in Java code.

      I have two HtmlSelectOneMenus. The first one (let's call it type) has statically assigned items. The second one (let's call it subtype) is dynamically filled based on the selected type.

      The problem I'm having is as the type changes the subtype is not re-rendered (refilled with new values). I debugged the code and both of the comboboxes are bound properly, values and id's are set properly as well. Below you can find the Java code snippet that is supposed to re-render the second (subtype) combobox.

      HtmlSelectOneMenu comboboxType = new HtmlSelectOneMenu();
      HtmlAjaxSupport ajaxSupportType = new HtmlAjaxSupport();
      comboboxType.getFacets().put("a4jsupport", ajaxSupportType);
      HtmlSelectOneMenu comboboxSubType = new HtmlSelectOneMenu();
      // value expressions are not shown...

      Would anyone see/know what the problem is and suggest a solution?

      Thank you for the reply.