// Otherwise, if the component should show the preview table, then
else if (inputFile.isShowPreview()) {
// Delegate writing of the entire <input type="file"...> ... </input> element to the delegate renderer.
DelegationResponseWriter delegationResponseWriter = new InputFileDelegationResponseWriter(responseWriter,
inputFile.isAuto());
super.encodeMarkupEnd(facesContext, uiComponent, delegationResponseWriter);
// Format the preview-table.html template and write it to the response.
Locale locale = facesContext.getViewRoot().getLocale();
String clientId = uiComponent.getClientId(facesContext);
PreviewTableTemplate previewTableTemplate = getPreviewTableTemplate(facesContext);
String previewTableHTML = previewTableTemplate.format(locale, clientId, false);
responseWriter.write(previewTableHTML);
// Finish encoding of the outermost <div> element.
responseWriter.endElement(StringPool.DIV);
}
// Otherwise, delegate writing of the entire <input type="file"...> ... </input> element to the delegate
// renderer.
else {
DelegationResponseWriter delegationResponseWriter = new InputFileDelegationResponseWriter(responseWriter,
inputFile.isAuto());
super.encodeMarkupEnd(facesContext, uiComponent, delegationResponseWriter);
}
}