1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<%@ page language="java" %>
<%@ page session="true" %>
<%@ page buffer="100kb" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="/tags/taglib" prefix="comp"%>
<html>
<head>
<script type="text/javascript" src="AjaxRequest.js"></script>
<style>
body{
font-family:Arial,Verdana;
font-size:12px;
width:600px;
}
text{
font-family:Arial,Verdana;
font-size:12px;
}
.progressBarDiv{
text-align:center;
}
.progressBar{
width:300px;
border: 1px solid gray;
}
.progressBarActiveCell{
background: white url(images/active.png) repeat-x top left;
height:21px;
}
.progressBarCell{
background: white url(images/normal.png) repeat-x top left;
height:21px;
}
.header{
font-size:13px;
font-weight:bold;
background-color:#6CBCE1;
color:black;
}
.gridPanel{
width:550px;
border:1px outset gray;
}
.gridPanel td{
text-align:center;
padding:10px;
}
</style>
</head>
<body>
<h2>Upload Page</h2>
<p>
On this page you can test the Ajax upload component.
Once you click on the upload button, the system will
process your selected file and store it to the temporary
directory of the web application.
</p>
<f:view>
<h:form id="UploadFileForm">
<h:panelGrid columns="1"
cellspacing="0"
styleClass="gridPanel"
headerClass="header">
<f:facet name="header">
<h:outputText value="Upload File" />
</f:facet>
<comp:fileUpload value="#{uploadPageBean.uploadedFile}"
uploadIcon="images/upload.png"
uploadOnMouseOver="this.setAttribute('src','images/upload-active.png');"
uploadOnMouseOut="this.setAttribute('src','images/upload.png');"
styleClass="progressBarDiv"
progressBarStyleClass="progressBar"
cellStyleClass="progressBarCell"
activeStyleClass="progressBarActiveCell">
<%--Below are the components that will be visible once the file upload completes--%>
<h:panelGrid columns="2" cellpadding="2" cellspacing="0" width="100%">
<f:facet name="header">
<h:outputText styleClass="text"
value="File Upload Successful - You can now continue to the next page or upload the file again." />
</f:facet>
<h:panelGroup style="text-align:left;display:block;width:100%;">
<h:commandButton action="#{uploadPageBean.reset}"
image="images/reset.png"
onmouseout="this.setAttribute('src','images/reset.png');"
onmouseover="this.setAttribute('src','images/reset-active.png');"/>
</h:panelGroup>
<h:panelGroup style="text-align:right;display:block;width:100%;">
<h:commandButton action="#{uploadPageBean.nextPage}"
image="images/continue.png"
onmouseout="this.setAttribute('src','images/continue.png');"
onmouseover="this.setAttribute('src','images/continue-active.png');"/>
</h:panelGroup>
</h:panelGrid>
</comp:fileUpload>
</h:panelGrid>
</h:form>
</f:view>
</body>
</html> |
Partager