Search code examples
xpageslotus-dominoxpages-ssjs

XPages: file download control shows wrong created and modified date


The XPages file download control shows wrong created and modified date

I have an XPages application running on a Domino 8.5.3 FP6 Server and I have to deal with the following known bugs:

LO68445: XPAGE: IN FILE DOWNLOAD CONTROL, CREATED COLUMN SHOWS DOCUMENT CREATED DATE, MODIFIED COLUMN SHOWS DOCUMENT MODIFIED DATE

LO61249: CUSTOMER | THE FILE DOWNLOAD CONTROL DOESN'T DISPLAY THE DATE ST AMP OF THE FILE ATTACHED


Take a look at the following screenshots:

First Step: Upload attachment ("added on" date is correct, because upload was done after the document creation)...

enter image description here

Second Step: Reopen the same document (as you can see the "added on" date is the same as the creation date of the document and that's wrong)...

enter image description here


Thanks in advance for any solution, workaround or alternative!


Solution

  • SOLUTION (WORKAROUND):

    After some investigations, I have found a possible workaround. The only thing you have to do is to override the createdValue attribute of the xp:fileDownload control:

    <xp:fileDownload id="fileDownload" indexVar="fileIndex" var="fileData" 
        hideWhen="false" value="#{currentDocument.Body}" sizeTitle="Size" 
        fileNameTitle="Filename" createdTitle="Added on">
        <xp:this.createdValue><![CDATA[#{javascript: //workaround
        if (fileIndex == 0 && @Attachments() <= 1) return @AttachmentModifiedTimes();
        else return @AttachmentModifiedTimes()[fileIndex];}]]></xp:this.createdValue>
    </xp:fileDownload>
    

    Any further solutions, workarounds are welcome!