<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

<f:subview id="FileUploadSubviewID">
	<rich:fileUpload id="fileUploadID" uploadData="#{fileUpload.data}"
		acceptedTypes="#{fileUpload.acceptedTypes}"
		disabled="#{fileUpload.disabled}" autoclear="#{fileUpload.autoclear}"
		required="#{fileUpload.required}"
		requiredMessage="#{fileUpload.requiredMessage}"
		rendered="#{fileUpload.rendered}"
		listHeight="#{fileUpload.listHeight}"
		listWidth="#{fileUpload.listWidth}"
		maxFilesQuantity="#{fileUpload.maxFilesQuantity}"
		fileUploadListener="#{fileUpload.fileUploadListener}"
		cleanButtonClass="style" onuploadcanceled="alert('hi')">
		<f:facet name="label">
			<h:outputText value="{_KB}KB from {KB}KB uploaded :[ {mm}:{ss} ]"></h:outputText>
		</f:facet>
	</rich:fileUpload>
	
	<h:panelGrid columns="2">
	<a4j:commandButton value="show file" reRender="fileUploadDataID"></a4j:commandButton>
	<h:dataTable id="fileUploadDataID" value="#{fileUpload.data}" var="item">
		<h:outputText value="#{item.fileName}"></h:outputText>
	</h:dataTable>
	</h:panelGrid>

	<h:panelGrid columns="2">
		<h:outputText value="acceptedTypes"></h:outputText>
		<h:inputText value="#{fileUpload.acceptedTypes}" onchange="submit();"></h:inputText>

		<h:outputText value="listHeight"></h:outputText>
		<h:inputText value="#{fileUpload.listHeight}" onchange="submit();"></h:inputText>

		<h:outputText value="listWidth"></h:outputText>
		<h:inputText value="#{fileUpload.listWidth}" onchange="submit();"></h:inputText>

		<h:outputText value="maxFilesQuantity"></h:outputText>
		<h:inputText value="#{fileUpload.maxFilesQuantity}"
			onchange="submit();"></h:inputText>

		<h:outputText value="autoclear"></h:outputText>
		<h:selectBooleanCheckbox value="#{fileUpload.autoclear}"
			onchange="submit();"></h:selectBooleanCheckbox>

		<h:outputText value="disabled"></h:outputText>
		<h:selectBooleanCheckbox value="#{fileUpload.disabled}"
			onchange="submit();"></h:selectBooleanCheckbox>

		<h:outputText value="rendered"></h:outputText>
		<h:selectBooleanCheckbox value="#{fileUpload.rendered}"
			onchange="submit();"></h:selectBooleanCheckbox>

		<h:outputText value="required"></h:outputText>
		<h:selectBooleanCheckbox value="#{fileUpload.required}"
			onchange="submit();"></h:selectBooleanCheckbox>

		<h:outputText value="requiredMessage"></h:outputText>
		<h:inputText value="#{fileUpload.requiredMessage}"
			onchange="submit();"></h:inputText>
	</h:panelGrid>
</f:subview>