[
https://issues.apache.org/jira/browse/TOMAHAWK-1258?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Simon Kitching deleted TOMAHAWK-1258:
-------------------------------------
> not working attributes actionListener on the datatable ?? help me please
> ----------------------------------------------------------------------------
>
> Key: TOMAHAWK-1258
> URL: https://issues.apache.org/jira/browse/TOMAHAWK-1258
> Project: MyFaces Tomahawk
> Issue Type: Bug
> Environment: window xp , tomcat 5.0 , java 1.4 , eclipse tool
> Reporter: HasunJoung
> Priority: Critical
>
> I usually use this tomahawk Extended Datatable , But I got a serious
> problem.
> <t:dataTable id="docuInfoList"
> value="#{fistDocuMgmtPageBean.docuInfoList}"
> var="docuInfo" >
> <t:column>
> <f:facet name="header">
> <t:outputText value="download"/>
> </f:facet>
> <t:commandLink id="download" immediate="true"
> actionListener="#{docuMgmtPageBean.fileDownAction}" >
> <t:graphicImage url="images/add.gif" />
> </t:commandLink>
>
> </t:column>
> </t:dataTable>
> I tried commandButton.. but attribute actionListener did not function..
> please help me..
> public void fileDownAction (ActionEvent event) {
> String filename = "StatWR.xls";
> String defaultPath = "c:/work/";
>
> //HttpServletRequest request =
> (HttpServletRequest)getExternalContext().getRequest();
> HttpServletResponse response =
> (HttpServletResponse)getExternalContext().getResponse();
>
> response.setContentType("application/vnd.ms-excel;
> charset=UTF-8");
>
> response.setHeader("Content-Disposition", "attachment;
> filename=" + filename);
> try {
> response.setHeader("Content-Disposition","attachment;
> filename="+URLEncoder.encode(filename, "UTF-8"));
> } catch (UnsupportedEncodingException e1) {
> e1.printStackTrace();
> }
>
> File file = new File(defaultPath + filename);
> byte[] bytestream = new byte[(int)file.length()];
>
> try{
> FileInputStream filestream = new FileInputStream(file);
> int i = 0, j = 0;
>
> while((i = filestream.read()) != -1) {
> bytestream[j] = (byte)i;
> j++;
> }
> OutputStream outStream = response.getOutputStream();
> outStream.write(bytestream);
> outStream.close();
> }catch(Exception e) {
> e.printStackTrace();
> }
> }
> I tried everything . And this Action function well not on the datatable..
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.