0
votes

Background: One xpage bound to document1. On this xpages is a tabbed table contain several tabs. Each tab contains an panel bound to other data sources incl document2. Document2 is created and made a child of document1. In each panel is a table to allow the user to create the new document, as well as two view controls. Everything works beautifully...until...

Problem: I was asked to add a way to upload an attachment to the child document. I first created an rich text field on the bound document called "ScannedInvoice". I then create a File Upload Control from the core controls and bound it to document2/ScannedInvoice. By rule, I only want a single attachment, otherwise I would consider the openNTF upload control.

I cannot figure out why nothing appears on the back end when I upload a file and create a new document. Everything else works, but there is no attachment in the ScannedInvoice field and also no $FILE fields attached to the document either.

Thanks in advance for any tips. I have searched quite a bit and have not found any answers. - Steve

<xp:fileUpload id="fileUpload1"
    value="#{document2.ScannedInvoice}" useUploadname="false"
    style="font-size:8pt" filename="scannedinvoice.jpg" 
    mimetype="image/jpeg">
</xp:fileUpload>

Note: The field ScannedInvoice on the Invoice form is rich text.

Code to save button: document2.save() Document2 has scope=request and ignoreRequestParam=true. Both of these have to be set like this in order to work. parentID=# document1.getNoteID()

1
do you save child document after upload? depending on your setup, if you initialize child document by unid, it may be always retrieved from database, so in memory document (where upload goes) may be discarded.Frantisek Kossuth
Yes, document is saved. The button saves the user entered fields to the child, as well as saves fields from the parent onto the child. Are you saying that the upload gets "lost" in memory and even though it is bound to the child document. Do I need to write SSJS to force the upload onto the child document??Steve Zavocki
depends on bindig. please update your question by adding source snippet.Frantisek Kossuth

1 Answers

7
votes

a file upload needs a full refresh of the page to be able to upload the file. Make sure that you are doing that.

======================================

Update Domino 9.0.1 supports partial refresh uploads