8 Replies Latest reply on Jun 18, 2009 12:50 PM by Andrey Filippov

    a4j:support dynamic creation issue

    Andrey Filippov Newbie

      Hi folks,
      I am trying to create my own tag using facelets. It consists of jsf input field, listbox and rich button. Besides that I would like to add a4j:support so - here is the code snippets:

      public class MySwitcher extends javax.faces.component.html.HtmlInputText{


      a4j support:

      private HtmlAjaxSupport addAjaxSupport(FacesContext context){
       HtmlAjaxSupport ajaxSupport = new HtmlAjaxSupport();
       ajaxSupport.setEvent("onkeyup");
       ajaxSupport.setReRender(getClientId(context) + "," + LIST_BOX);
       ajaxSupport.setEventsQueue(eventsQueue);
       return ajaxSupport;
       }


      inserting:

      @Override
       public void encodeBegin(FacesContext context) throws IOException {
       ResponseWriter writer = context.getResponseWriter();
       writer.startElement("div", null);
       super.encodeBegin(context);
       this.getFacets().put("ajaxSupport", addAjaxSupport(context));
       }

      Finally html code looks incomplete:

      onkeyup="A4J.AJAX.Submit('_viewRoot','my_main_form',event,{'similarityGroupingId':'my_main_form:j_id115','parameters':{'my_main_form:j_id115':'my_main_form:j_id115'} ,'actionUrl':'/root/camps/location/mySwitcherTest.xhtml'} )"

      but as I understand to reRender components 'affected' should presents.. What could be the problem?
      Thanks.