Abbreviate filenames in fileDownload control


<xp:fileDownload rows="30"
	id="fileDownloadControl" displayLastModified="false"
	value="#{myDoc.attachmentField}" hideWhen="true"
	displayCreated="false" displaySize="false" displayType="false"
	allowDelete="true" style="width:100%" 
	var="fileVariable">
	<xp:this.fileNameValue><![CDATA[#{javascript:
		var fileName = fileVariable.getName();
		if (fileName.length > 25) {
			return @Left(fileName, 25)  + "...";
		} else {
			return fileName;
		}}]]>
	</xp:this.fileNameValue>
</xp:fileDownload>
All code submitted to OpenNTF XSnippets, whether submitted as a "Snippet" or in the body of a Comment, is provided under the Apache License Version 2.0. See Terms of Use for full details.
No comments yetLogin first to comment...