203 anonyme User
77156 Mitglieder freuen sich auf Dich!
Top-Aktivitäten
Sehen Sie hier, wer zu den aktivsten Mitgliedern der aktuellen Woche zählt:
203 anonyme User
<td><img src="C:\glassfishv3\glassfish\domains\domain1\applications\PTB_Test\WEB-INF\pic\Winter.jpg" height="80" width="100" /></td> <td><input id="frm:Pic:3:j_idt9" type="submit" name="frm:Pic:3:j_idt9" value="" onclick="mojarra.ab(this,event,'action','frm2','frm2:BIGPIC',{'bigPic':'Winter.jpg'});return false" /></td><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"> <h:head> <style type="text/css"> #div1 { width: 150px; height: 500px; overflow-y: scroll; } </style> </h:head> <body> <table> <tr> <td> <div id="div1"><h:form id="frm"> <h:dataTable id="Pic" value="#{PicLoader.perInfoAll }" var="Pic"> <h:column> <h:graphicImage value="#{Pic.absolutePath}" width="100" height="80" /> </h:column> <h:column> <h:commandButton action="#{LoadBigPic.listener}"> <f:param name="bigPic" value="#{Pic.picName}" /> <f:ajax execute=":frm2" render=":frm2:BIGPIC" event="action" /> </h:commandButton> </h:column> </h:dataTable> </h:form></div> </td> <td><h:form id="frm2"> <h:graphicImage id="BIGPIC" value="#{LoadBigPic.bigPic }" /> </h:form></td> </tr> </table> </body> </html>package roseindia; import java.io.File; import java.util.ArrayList; import java.util.List; public class PicLoader { private List<TableData> getPictureList = new ArrayList<TableData>(); int counter1 = 1; // File thumbFile = new File("C:\\pic\\"); File thumbFile = new File( "C:\\glassfishv3\\glassfish\\domains\\domain1\\applications\\PTB_Test\\WEB-INF\\pic\\"); // File thumbFile = new File("/PTB_Test/WEB-INF/pic/"); // File thumbFile = new File("..\\docroot\\pic\\"); File[] files = null; private List<String> loadedFiles = new ArrayList<String>(); public void setPerInfoAll(List<TableData> perInfoAll) { this.getPictureList = perInfoAll; } public List<TableData> getPerInfoAll() { try { files = thumbFile.listFiles(); for (File file : files) { if (file.getName().endsWith(".jpg") && !loadedFiles.contains(file.getAbsolutePath())) { getPictureList.add(new TableData(file.getAbsolutePath(), file.getName())); // add to loaded files loadedFiles.add(file.getAbsolutePath()); System.out.println("Hier bin ich"); } } } catch (Exception e) { System.out.println("Error Data: " + e.getMessage()); } return getPictureList; } public class TableData { private String absolutePath; private String picName; public String getPicName() { return picName; } public void setPicName(String picName) { this.picName = picName; } public TableData(String absolutePath, String picName) { this.absolutePath = absolutePath; this.picName = picName; } public String getAbsolutePath() { return absolutePath; } public void setAbsolutePath(String absolutePath) { this.absolutePath = absolutePath; } } }