1 Reply Latest reply on Jan 22, 2008 4:00 AM by albluca02

    a4j:support - ActionListener - is that the right way of doin

    albluca02

      Hello,
      I am using an ActioListener inside a a4j:support to reset some field values in my form and backing bean.
      I found a working way of doing, I ask you: is that a right way of doing it?
      Thank you

      page:

      ....
      <a4j:support event="onclick" ajaxSingle="true" action="#{affiliazione.datiAlboNazionaleChanged}" reRender="numeroIscrizioneAlbo,albo,dataIscrizioneAlbo"/>
      ...


      backing bean:

      public void datiAlboNazionaleChanged()
      {
      FacesContext ctx = FacesContext.getCurrentInstance();
      UIInput cmp = (UIInput) ctx.getViewRoot().findComponent(getFormId() + ":numeroIscrizioneAlbo");
      cmp.setSubmittedValue(null);
      getModuloAffiliazione().getDatiAnagraficiFiscali().setNumeroIscrizioneAlbo(null);
      cmp = (UIInput) ctx.getViewRoot().findComponent(getFormId() + ":albo");
      cmp.setSubmittedValue(null);
      getModuloAffiliazione().getDatiAnagraficiFiscali().setAlbo(null);
      cmp = (UIInput) ctx.getViewRoot().findComponent(getFormId() + ":dataIscrizioneAlbo");
      cmp.setSubmittedValue(null);
      getModuloAffiliazione().getDatiAnagraficiFiscali().setDataIscrizioneAlbo(null);
      }