facesContext.getApplication().getStateManager().saveSerializedView(
facesContext);
regards...
On 5/4/06, Le Van <[EMAIL PROTECTED]> wrote:
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
--
Murat HAZER
Elektrik-Elektronik Mühendisi - Electrical-Electronics Engineer
Tel - Phone: +90 222 335 05 80 - 1395
Cep Tel - Mobile Phone: +90 532 472 00 63
Blog URL: http://www.projedunyasi.org
Yahoo Group: http://groups.yahoo.com/group/malatyafenlisesi/

