|
Hi all, I got a problem with t:commandButton. I have Search screen. First, I push Search button to get data from DB. Then I push OutputCSV button to get data results as csv file. Everything is OK.Now I push search again, but action is not been called for all command button on the screen ( except h:commandLink can take an action). Here is my code to get data as csv. public String outputCSVAction() { FacesContext facesContext = FacesContext.getCurrentInstance(); HttpServletResponse response = (HttpServletResponse) facesContext.getExternalContext().getResponse(); ByteArrayOutputStream arrayOutputStream = new ByteArrayOutputStream(); List dataList = pageObject.getDataList(); for (Iterator iter = dataList.iterator(); iter.hasNext();) { TM00403ItemRow element = (TM00403ItemRow) iter.next(); prepareCSV(element, arrayOutputStream); } response.setContentType("application/x-download; charset=shift_jis"); response.setHeader("Content-disposition","attachment; filename=\"" + TMCommonConstants.OUTPUT_CSV + "\""); ServletOutputStream outputStream = response.getOutputStream(); outputStream.write(arrayOutputStream.toByteArray()); response.setContentLength(arrayOutputStream.size()); outputStream.flush(); outputStream.close(); facesContext.responseComplete(); } Could anyone help me ? Thanks for advance, Van Le |
- t:commandButton action method not called Le Van

