1 Reply Latest reply on May 12, 2008 5:04 AM by juanignaciosl

    h:commandLink and t: won't work right with 3.1.5

    juanignaciosl

      After upgrading to 3.1.5 h:commandLink and t:commandLink won't send parameters, as I've stated at this Jira issue: http://jira.jboss.com/jira/browse/RF-3378. The workaround (substituting h: and t: with a4j:) works most of times, but I still have a problem: I have a commandLink which downloads an excel file. h:commandLink works as expected, but a4j:commandLink doesn't. Instead of downloading the file browser opens a page with strange characters.

      This is the tag:
      <h:commandLink value="#{mesgVerAcciones.boton_excel}"
      rendered="#{(accionFiltro.tipoAccion == 'MAI')}"
      styleClass="botonImagen botonExcel" requestDelay="500"
      actionListener="#{accionesBean.descargaExcel}" />


      and this is the important code at the bean:

      ...
      final FacesContext context = FacesContext.getCurrentInstance();
      final HttpServletResponse response = (HttpServletResponse) context.getExternalContext().getResponse();

      response.setContentType("application/OCTET-STREAM");
      response.setHeader("Content-Disposition", "attachment;filename=\"Publicaciones.xls\"");

      /*Genero el Excel en el flujo de salida*/
      wb.write(response.getOutputStream());
      context.responseComplete();
      }